diff --git a/fastapi/middleware/asyncexitstack.py b/fastapi/middleware/asyncexitstack.py index 6723638f1..4ce3f5a62 100644 --- a/fastapi/middleware/asyncexitstack.py +++ b/fastapi/middleware/asyncexitstack.py @@ -3,6 +3,8 @@ from contextlib import AsyncExitStack from starlette.types import ASGIApp, Receive, Scope, Send +# Used mainly to close files after the request is done, dependencies are closed +# in their own AsyncExitStack class AsyncExitStackMiddleware: def __init__( self, app: ASGIApp, context_name: str = "fastapi_middleware_astack"