summaryrefslogtreecommitdiff
path: root/ext/http/01_http.js
diff options
context:
space:
mode:
authorDayan C. Galiazzi <galiazzi.dayan@gmail.com>2021-08-24 19:55:32 -0300
committerGitHub <noreply@github.com>2021-08-25 00:55:32 +0200
commit873cce27b8f1b7900ea08c85b2d563ddd478a38a (patch)
tree017b3aa793d22d1c71a9a655baff1ea998eed224 /ext/http/01_http.js
parenta3fd4bb998d875e130ad0db40d9392192468bba1 (diff)
fix(ext/http): websocket upgrade header check (#11830)
Diffstat (limited to 'ext/http/01_http.js')
-rw-r--r--ext/http/01_http.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/http/01_http.js b/ext/http/01_http.js
index b14a0d352..073cc7a7c 100644
--- a/ext/http/01_http.js
+++ b/ext/http/01_http.js
@@ -341,7 +341,8 @@
const _ws = Symbol("[[associated_ws]]");
function upgradeWebSocket(request, options = {}) {
- if (request.headers.get("upgrade") !== "websocket") {
+ const upgrade = request.headers.get("upgrade");
+ if (!upgrade || StringPrototypeToLowerCase(upgrade) !== "websocket") {
throw new TypeError(
"Invalid Header: 'upgrade' header must be 'websocket'",
);