diff --git a/starlette/middleware/base.py b/starlette/middleware/base.py index 6c6a43b16..d0089c0c9 100644 --- a/starlette/middleware/base.py +++ b/starlette/middleware/base.py @@ -3,7 +3,7 @@ from starlette.requests import Request from starlette.responses import Response, StreamingResponse -from starlette.types import ASGIApp, Receive, Scope, Send +from starlette.types import ASGIApp, Message, Receive, Scope, Send RequestResponseEndpoint = typing.Callable[[Request], typing.Awaitable[Response]] DispatchFunction = typing.Callable[ @@ -27,7 +27,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: async def call_next(self, request: Request) -> Response: loop = asyncio.get_event_loop() - queue = asyncio.Queue() # type: asyncio.Queue + queue: "asyncio.Queue[typing.Optional[Message]]" = asyncio.Queue(maxsize=1) scope = request.scope receive = request.receive