@@ -259,5 +259,7 @@ /* eslint no-unused-vars: ["error", { "varsIgnorePattern": "^Duplex$", "caughtErrors": "none" }] */ | ||
| if (version !== 8 && version !== 13) { | ||
| if (version !== 13 && version !== 8) { | ||
| const message = 'Missing or invalid Sec-WebSocket-Version header'; | ||
| abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); | ||
| abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, { | ||
| 'Sec-WebSocket-Version': '13, 8' | ||
| }); | ||
| return; | ||
@@ -530,5 +532,13 @@ } | ||
| * @param {String} message The HTTP response body | ||
| * @param {Object} [headers] The HTTP response headers | ||
| * @private | ||
| */ | ||
| function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) { | ||
| function abortHandshakeOrEmitwsClientError( | ||
| server, | ||
| req, | ||
| socket, | ||
| code, | ||
| message, | ||
| headers | ||
| ) { | ||
| if (server.listenerCount('wsClientError')) { | ||
@@ -540,4 +550,4 @@ const err = new Error(message); | ||
| } else { | ||
| abortHandshake(socket, code, message); | ||
| abortHandshake(socket, code, message, headers); | ||
| } | ||
| } |
+1
-1
| { | ||
| "name": "ws", | ||
| "version": "8.18.2", | ||
| "version": "8.18.3", | ||
| "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 4 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
147320
0.09%4239
0.24%