Catch SSL crashes while writing the response (Fixes #206)
This commit is contained in:
@@ -1336,9 +1336,9 @@ class Microdot:
|
|||||||
print_exception(exc)
|
print_exception(exc)
|
||||||
|
|
||||||
res = await self.dispatch_request(req)
|
res = await self.dispatch_request(req)
|
||||||
if res != Response.already_handled: # pragma: no branch
|
|
||||||
await res.write(writer)
|
|
||||||
try:
|
try:
|
||||||
|
if res != Response.already_handled: # pragma: no branch
|
||||||
|
await res.write(writer)
|
||||||
await writer.aclose()
|
await writer.aclose()
|
||||||
except OSError as exc: # pragma: no cover
|
except OSError as exc: # pragma: no cover
|
||||||
if exc.errno in MUTED_SOCKET_ERRORS:
|
if exc.errno in MUTED_SOCKET_ERRORS:
|
||||||
|
|||||||
Reference in New Issue
Block a user