ws
Advanced tools
Comparing version 8.8.0 to 8.8.1
@@ -716,7 +716,7 @@ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Readable$" }] */ | ||
opts.headers = { | ||
...opts.headers, | ||
'Sec-WebSocket-Version': opts.protocolVersion, | ||
'Sec-WebSocket-Key': key, | ||
Connection: 'Upgrade', | ||
Upgrade: 'websocket', | ||
...opts.headers | ||
Upgrade: 'websocket' | ||
}; | ||
@@ -775,4 +775,7 @@ opts.path = parsedUrl.pathname + parsedUrl.search; | ||
if (websocket._redirects === 0) { | ||
websocket._originalUnixSocket = isUnixSocket; | ||
websocket._originalSecure = isSecure; | ||
websocket._originalHost = parsedUrl.host; | ||
websocket._originalHostOrSocketPath = isUnixSocket | ||
? opts.socketPath | ||
: parsedUrl.host; | ||
@@ -793,3 +796,9 @@ const headers = options && options.headers; | ||
} else if (websocket.listenerCount('redirect') === 0) { | ||
const isSameHost = parsedUrl.host === websocket._originalHost; | ||
const isSameHost = isUnixSocket | ||
? websocket._originalUnixSocket | ||
? opts.socketPath === websocket._originalHostOrSocketPath | ||
: false | ||
: websocket._originalUnixSocket | ||
? false | ||
: parsedUrl.host === websocket._originalHostOrSocketPath; | ||
@@ -796,0 +805,0 @@ if (!isSameHost || (websocket._originalSecure && !isSecure)) { |
{ | ||
"name": "ws", | ||
"version": "8.8.0", | ||
"version": "8.8.1", | ||
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
134597
3897