diff --git a/sanic/app.py b/sanic/app.py index c801cd3d57..6861bca013 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -775,6 +775,14 @@ async def handle_exception( 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(