fix: pass gateway token via URL query parameter
Gateway may validate auth during HTTP upgrade before WebSocket messages can be sent. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -212,7 +212,9 @@ export default {
|
|||||||
reject(new Error('Gateway connection timeout'));
|
reject(new Error('Gateway connection timeout'));
|
||||||
}, 15000);
|
}, 15000);
|
||||||
|
|
||||||
const client = new (globalThis as any).WebSocket(gatewayUrl);
|
// Pass token via Authorization header in the upgrade request
|
||||||
|
const wsUrl = gwToken ? `${gatewayUrl}?token=${encodeURIComponent(gwToken)}` : gatewayUrl;
|
||||||
|
const client = new (globalThis as any).WebSocket(wsUrl);
|
||||||
|
|
||||||
client.onerror = (err: any) => {
|
client.onerror = (err: any) => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|||||||
Reference in New Issue
Block a user