From 1c084887c175e595acda8470d662a74e148b2f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 1 Nov 2025 17:08:32 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20running=20WebSocket=20func?= =?UTF-8?q?tion=20inside=20both=20async=20exit=20stacks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index ec4e0955b..cd3a6e043 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -146,7 +146,7 @@ def websocket_session( scope["fastapi_inner_astack"] = request_stack async with AsyncExitStack() as function_stack: scope["fastapi_function_astack"] = function_stack - await func(session) + await func(session) # Same as in Starlette await wrap_app_handling_exceptions(app, session)(scope, receive, send)