Previous fix used Context.WebSockets.IsWebSocketRequest, but that requires UseWebSockets() to have already run — and UseBattleNode (which calls UseWebSockets) is registered AFTER UseAuthentication in Program.cs, so the WS feature isn't installed when auth runs. Switch to reading the raw Upgrade header, which works regardless of middleware order. Also split the WS handler's "Unknown battle/viewer pair" warning into two distinct cases so we can tell unknown-BattleId from viewer-id-mismatch (which lets us see whether the bridge stored the right viewer or the client is encrypting a different id). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3.3 KiB
3.3 KiB