From 025acdccf149102ae625d5242497d4aa0e1b6902 Mon Sep 17 00:00:00 2001 From: khushal Date: Thu, 2 Jan 2025 13:42:35 +0000 Subject: [PATCH] (20250102) SocketIO Tick-Out test --- wsio/finstitutions/trading/tick_out.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wsio/finstitutions/trading/tick_out.py b/wsio/finstitutions/trading/tick_out.py index 2ff3133..2b8c0f8 100644 --- a/wsio/finstitutions/trading/tick_out.py +++ b/wsio/finstitutions/trading/tick_out.py @@ -403,12 +403,14 @@ async def on_connect(sid, environ, *args) -> bool: return False # Check the origin of the incoming request: + printer("Checking origin.") origin = environ.get("HTTP_ORIGIN", "???") if not origin_is_allowed(origin): printer("SOCKET REJECTED: Bad origin.", sid, origin) return False # Get the session token from the incoming request: + printer("Checking session token.") session_token = environ.get("HTTP_X_SESSION_TOKEN") if not session_token and len(args) > 0: session_token = args[0].get("X-Session-Token") if not session_token: @@ -416,6 +418,7 @@ async def on_connect(sid, environ, *args) -> bool: return False # Get the user's details from the session token: + printer("Fetching user info.") user_info = await redis_cache.get(key = session_token) if not user_info: printer("SOCKET REJECTED: Invalid session token.", sid)