Skip to content

Commit

Permalink
minor rename
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Oct 20, 2021
1 parent b65eefa commit 1697375
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ async def _middleware_handler(request: web.Request, handler: Handler):
return _middleware_handler


_FlexibleReturns = Union[StreamResponse, _DataType]
HandlerFlexible = Callable[[Request], Awaitable[_FlexibleReturns]]
_ResponseOrBodyData = Union[StreamResponse, _DataType]
HandlerFlexible = Callable[[Request], Awaitable[_ResponseOrBodyData]]
MiddlewareFlexible = Callable[[Request, HandlerFlexible], Awaitable[StreamResponse]]


Expand All @@ -199,7 +199,7 @@ async def _middleware_handler(
return resp

# WARNING: this is not a handler in the classic way
resp: _FlexibleReturns = await handler(request)
resp: _ResponseOrBodyData = await handler(request)

if isinstance(resp, web.FileResponse):
# WARNING: allows for files to be downloaded
Expand Down

0 comments on commit 1697375

Please sign in to comment.