Browse Source

refactor: remove deprecated WebSocket fastapi_astack scope

This scope was kept for compatibility but is no longer used by FastAPI.
Removing it reduces WebSocket connection overhead.
pull/13874/head
kim 1 week ago
parent
commit
ffde6da87d
  1. 4
      fastapi/routing.py

4
fastapi/routing.py

@ -364,10 +364,6 @@ def get_websocket_app(
) -> Callable[[WebSocket], Coroutine[Any, Any, Any]]:
async def app(websocket: WebSocket) -> None:
async with AsyncExitStack() as async_exit_stack:
# TODO: remove this scope later, after a few releases
# This scope fastapi_astack is no longer used by FastAPI, kept for
# compatibility, just in case
websocket.scope["fastapi_astack"] = async_exit_stack
solved_result = await solve_dependencies(
request=websocket,
dependant=dependant,

Loading…
Cancel
Save