feat: only stream last chunk if client is connected (#4015)

This commit is contained in:
cthomas
2025-08-19 14:46:30 -07:00
committed by GitHub
parent e36fd6f46d
commit b1f1d0a5bf

View File

@@ -332,5 +332,5 @@ class StreamingResponseWithStatusCode(StreamingResponse):
)
capture_sentry_exception(exc)
return
if more_body:
if more_body and self._client_connected:
await send({"type": "http.response.body", "body": b"", "more_body": False})