fix(platform): preserve session failures and URL syntax

This commit is contained in:
2026-09-05 06:38:00 +08:00
parent 7e5a950cc7
commit 224df1c21c
6 changed files with 123 additions and 8 deletions
@@ -512,6 +512,10 @@ test('PlatformHandlers validates every switch URL before closing the active game
'http://invalid.example',
'ws://user@example.com',
'ws://example.com/#fragment',
'ws://example.com/#',
'ws://example.com#',
'ws://@example.com',
'ws://:@example.com',
'ws:///path',
'ws://example.com:99999',
'ws://example.com:abc',
@@ -544,7 +548,10 @@ test('PlatformHandlers validates every switch URL before closing the active game
test('PlatformHandlers accepts case-insensitive WS/WSS schemes and preserves full payload identity', () => {
const setup = makeHandlers();
const roomData = { roomserver: 'WS://EXAMPLE.com:80/path?x=1', extra: { trace: 1 } };
const roomData = {
roomserver: 'WS://EXAMPLE.com:80/path/%23anchor?x=1',
extra: { trace: 1 },
};
const agentData = {
agentserver: 'WSS://secure.example:443/socket', opt: 'free_room', extra: { trace: 2 },
};