Dispatch http.lifecyle.response from exception handler (#2299)
This commit is contained in:
parent
9c576c74db
commit
722a6db8d9
|
@ -775,6 +775,14 @@ class Sanic(BaseSanic, metaclass=TouchUpMeta):
|
|||
if request.stream:
|
||||
response = request.stream.response
|
||||
if isinstance(response, BaseHTTPResponse):
|
||||
await self.dispatch(
|
||||
"http.lifecycle.response",
|
||||
inline=True,
|
||||
context={
|
||||
"request": request,
|
||||
"response": response,
|
||||
},
|
||||
)
|
||||
await response.send(end_stream=True)
|
||||
else:
|
||||
raise ServerError(
|
||||
|
|
Loading…
Reference in New Issue
Block a user