Close server session after handle stateless request (#1116)

This commit is contained in:
hopeful0 2025-07-15 00:26:06 +08:00 • committed by GitHub
commit b8cb3675dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -612,7 +612,7 @@ class StreamableHTTPServerTransport:
if not await self._validate_request_headers(request, send):
return
await self._terminate_session()
await self.terminate()
response = self._create_json_response(
None,
@ -620,7 +620,7 @@ class StreamableHTTPServerTransport:
)
await response(request.scope, request.receive, send)
async def _terminate_session(self) -> None:
async def terminate(self) -> None:
"""Terminate the current session, closing all streams.
Once terminated, all requests with this session ID will receive 404 Not Found.