From ed0093d4e6329a5931e4ece533d11df634e89b1c Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Fri, 19 Jul 2024 03:40:07 +0000 Subject: [PATCH] actually fix asgi scope Signed-off-by: Teo Koon Peng --- packages/api-server/api_server/fast_io/__init__.py | 2 +- packages/api-server/api_server/test/test_fixtures.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/api-server/api_server/fast_io/__init__.py b/packages/api-server/api_server/fast_io/__init__.py index e2b9a6b51..60c744091 100644 --- a/packages/api-server/api_server/fast_io/__init__.py +++ b/packages/api-server/api_server/fast_io/__init__.py @@ -244,7 +244,7 @@ def _match_routes( return None async def _on_connect(self, sid: str, environ: dict, auth: dict | None = None): - logger = get_logger(HTTPConnection(environ["asgi"])) + logger = get_logger(HTTPConnection(environ["asgi.scope"])) user = ( await self._socketio_connect(sid, environ, auth) if self._socketio_connect diff --git a/packages/api-server/api_server/test/test_fixtures.py b/packages/api-server/api_server/test/test_fixtures.py index 9d3794f61..03ce6244c 100644 --- a/packages/api-server/api_server/test/test_fixtures.py +++ b/packages/api-server/api_server/test/test_fixtures.py @@ -200,7 +200,7 @@ async def handle_resp(emit_room, msg, *_args, **_kwargs): portal.call( on_sio_connect, "test", - {"asgi": mock_scope}, + {"asgi.scope": mock_scope}, {"token": self.client.token(user)}, ) connected = True