Skip middleware on RequestCancelled (#2720)

This commit is contained in:
Adam Hopkins 2023-03-20 13:00:34 +02:00 committed by GitHub
parent 53820bc241
commit ac1f56118a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -428,7 +428,9 @@ class Http(Stream, metaclass=TouchUpMeta):
if self.request is None: if self.request is None:
self.create_empty_request() self.create_empty_request()
request_middleware = not isinstance(exception, ServiceUnavailable) request_middleware = not isinstance(
exception, (ServiceUnavailable, RequestCancelled)
)
try: try:
await app.handle_exception( await app.handle_exception(
self.request, exception, request_middleware self.request, exception, request_middleware