fix: websocket subprotocols (#7472)

This commit is contained in:
André Ricardo 2024-06-03 05:14:53 -03:00 committed by GitHub
parent 109258db41
commit 11524580d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -220,7 +220,7 @@ const openWebSocketConnection = async (
'on': true, 'on': true,
'global': settings.followRedirects, 'global': settings.followRedirects,
}[request.settingFollowRedirects] ?? true; }[request.settingFollowRedirects] ?? true;
const protocols = lowerCasedEnabledHeaders['sec-websocket-protocol']; const protocols = lowerCasedEnabledHeaders['sec-websocket-protocol']?.split(',').map(p => p.trim());
const ws = new WebSocket(url, protocols, { const ws = new WebSocket(url, protocols, {
headers: lowerCasedEnabledHeaders, headers: lowerCasedEnabledHeaders,
ca: caCertificate, ca: caCertificate,