Comparing version 7.5.7 to 7.5.8
@@ -687,2 +687,3 @@ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Readable$" }] */ | ||
if (websocket._redirects === 0) { | ||
websocket._originalSecure = isSecure; | ||
websocket._originalHost = parsedUrl.host; | ||
@@ -703,11 +704,17 @@ | ||
} | ||
} else if (parsedUrl.host !== websocket._originalHost) { | ||
// | ||
// Match curl 7.77.0 behavior and drop the following headers. These | ||
// headers are also dropped when following a redirect to a subdomain. | ||
// | ||
delete opts.headers.authorization; | ||
delete opts.headers.cookie; | ||
delete opts.headers.host; | ||
opts.auth = undefined; | ||
} else { | ||
const isSameHost = parsedUrl.host === websocket._originalHost; | ||
if (!isSameHost || (websocket._originalSecure && !isSecure)) { | ||
// | ||
// Match curl 7.77.0 behavior and drop the following headers. These | ||
// headers are also dropped when following a redirect to a subdomain. | ||
// | ||
delete opts.headers.authorization; | ||
delete opts.headers.cookie; | ||
if (!isSameHost) delete opts.headers.host; | ||
opts.auth = undefined; | ||
} | ||
} | ||
@@ -788,2 +795,7 @@ | ||
if (res.headers.upgrade.toLowerCase() !== 'websocket') { | ||
abortHandshake(websocket, socket, 'Invalid Upgrade header'); | ||
return; | ||
} | ||
const digest = createHash('sha1') | ||
@@ -790,0 +802,0 @@ .update(key + GUID) |
{ | ||
"name": "ws", | ||
"version": "7.5.7", | ||
"version": "7.5.8", | ||
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121861
3544