mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-30 08:04:09 +00:00
fix: ensure protocolVersion is a number in WebSocket options (#6013)
This commit is contained in:
committed by
GitHub
parent
1ac128e35c
commit
24a36bc355
@@ -67,7 +67,11 @@ class WsClient {
|
||||
};
|
||||
|
||||
if (protocolVersion) {
|
||||
wsOptions.protocolVersion = protocolVersion;
|
||||
// Force convert to number since `ws` doesn't do it for you
|
||||
const asNumber = Number(protocolVersion);
|
||||
if (!isNaN(asNumber)) {
|
||||
wsOptions.protocolVersion = asNumber;
|
||||
}
|
||||
}
|
||||
|
||||
const wsConnection = new ws.WebSocket(parsedUrl.fullUrl, protocols, wsOptions);
|
||||
|
||||
@@ -13,6 +13,7 @@ ws {
|
||||
headers {
|
||||
Sec-WebSocket-Protocol: soap
|
||||
Sec-WebSocket-Protocol: mqtt
|
||||
Sec-WebSocket-Version: 13
|
||||
}
|
||||
|
||||
body:ws {
|
||||
|
||||
Reference in New Issue
Block a user