summary refs log tree commit diff
path: root/src/gateway/events/Connection.ts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-07 23:18:57 +0100
committerRory& <root@rory.gay>2025-12-12 22:56:02 +0100
commitbdbf6d06b25fcdb2e9cbcdd32872ae62bfc8893c (patch)
tree76e769af417dba58a85d53996b3993ea073e2170 /src/gateway/events/Connection.ts
parentMerge remote-tracking branch 'BrajamohanDas-afk/refactor/remove-getIpAddress'... (diff)
downloadserver-ts-bdbf6d06b25fcdb2e9cbcdd32872ae62bfc8893c.tar.xz
Fix IP tracking for bans
Diffstat (limited to 'src/gateway/events/Connection.ts')
-rw-r--r--src/gateway/events/Connection.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gateway/events/Connection.ts b/src/gateway/events/Connection.ts

index bc74dee6..9b132d4b 100644 --- a/src/gateway/events/Connection.ts +++ b/src/gateway/events/Connection.ts
@@ -72,6 +72,13 @@ export async function Connection( ); } + if (request.headers.cookie?.split("; ").find(x => x.startsWith("__sb_sessid="))) { + socket.fingerprint = request.headers.cookie + .split("; ") + .find((x) => x.startsWith("__sb_sessid=")) + ?.split("=")[1]; + } + //Create session ID when the connection is opened. This allows gateway dump to group the initial websocket messages with the rest of the conversation. const session_id = genSessionId(); socket.session_id = session_id; //Set the session of the WebSocket object