Comparing version 8.8.1 to 8.9.0
@@ -680,16 +680,16 @@ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Readable$" }] */ | ||
const isSecure = parsedUrl.protocol === 'wss:'; | ||
const isUnixSocket = parsedUrl.protocol === 'ws+unix:'; | ||
let invalidURLMessage; | ||
const isIpcUrl = parsedUrl.protocol === 'ws+unix:'; | ||
let invalidUrlMessage; | ||
if (parsedUrl.protocol !== 'ws:' && !isSecure && !isUnixSocket) { | ||
invalidURLMessage = | ||
if (parsedUrl.protocol !== 'ws:' && !isSecure && !isIpcUrl) { | ||
invalidUrlMessage = | ||
'The URL\'s protocol must be one of "ws:", "wss:", or "ws+unix:"'; | ||
} else if (isUnixSocket && !parsedUrl.pathname) { | ||
invalidURLMessage = "The URL's pathname is empty"; | ||
} else if (isIpcUrl && !parsedUrl.pathname) { | ||
invalidUrlMessage = "The URL's pathname is empty"; | ||
} else if (parsedUrl.hash) { | ||
invalidURLMessage = 'The URL contains a fragment identifier'; | ||
invalidUrlMessage = 'The URL contains a fragment identifier'; | ||
} | ||
if (invalidURLMessage) { | ||
const err = new SyntaxError(invalidURLMessage); | ||
if (invalidUrlMessage) { | ||
const err = new SyntaxError(invalidUrlMessage); | ||
@@ -764,3 +764,3 @@ if (websocket._redirects === 0) { | ||
if (isUnixSocket) { | ||
if (isIpcUrl) { | ||
const parts = opts.path.split(':'); | ||
@@ -776,5 +776,5 @@ | ||
if (websocket._redirects === 0) { | ||
websocket._originalUnixSocket = isUnixSocket; | ||
websocket._originalIpc = isIpcUrl; | ||
websocket._originalSecure = isSecure; | ||
websocket._originalHostOrSocketPath = isUnixSocket | ||
websocket._originalHostOrSocketPath = isIpcUrl | ||
? opts.socketPath | ||
@@ -797,7 +797,7 @@ : parsedUrl.host; | ||
} else if (websocket.listenerCount('redirect') === 0) { | ||
const isSameHost = isUnixSocket | ||
? websocket._originalUnixSocket | ||
const isSameHost = isIpcUrl | ||
? websocket._originalIpc | ||
? opts.socketPath === websocket._originalHostOrSocketPath | ||
: false | ||
: websocket._originalUnixSocket | ||
: websocket._originalIpc | ||
? false | ||
@@ -804,0 +804,0 @@ : parsedUrl.host === websocket._originalHostOrSocketPath; |
{ | ||
"name": "ws", | ||
"version": "8.8.1", | ||
"version": "8.9.0", | ||
"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
134548