diff options
| author | Egor Tensin <egor@tensin.name> | 2026-03-14 12:19:48 +0100 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-03-14 12:19:48 +0100 |
| commit | 5736345440e43ac7f8d72c748c6b959bee5f8aa8 (patch) | |
| tree | 367b7d90a8d2e199b70a196a1a91c2aa267c5633 /node_modules/undici/lib/web/websocket/util.js | |
| parent | Merge pull request #8 from egor-tensin/dependabot/npm_and_yarn/undici-6.24.1 (diff) | |
| download | cleanup-path-5736345440e43ac7f8d72c748c6b959bee5f8aa8.tar.gz cleanup-path-5736345440e43ac7f8d72c748c6b959bee5f8aa8.zip | |
wait, what the hell? doesn't Dependabot update node_modules as well?
Diffstat (limited to 'node_modules/undici/lib/web/websocket/util.js')
| -rw-r--r-- | node_modules/undici/lib/web/websocket/util.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/node_modules/undici/lib/web/websocket/util.js b/node_modules/undici/lib/web/websocket/util.js index e5ce789..2a04887 100644 --- a/node_modules/undici/lib/web/websocket/util.js +++ b/node_modules/undici/lib/web/websocket/util.js @@ -266,6 +266,12 @@ function parseExtensions (extensions) { * @param {string} value */ function isValidClientWindowBits (value) { + // Must have at least one character + if (value.length === 0) { + return false + } + + // Check all characters are ASCII digits for (let i = 0; i < value.length; i++) { const byte = value.charCodeAt(i) @@ -274,7 +280,9 @@ function isValidClientWindowBits (value) { } } - return true + // Check numeric range: zlib requires windowBits in range 8-15 + const num = Number.parseInt(value, 10) + return num >= 8 && num <= 15 } // https://nodejs.org/api/intl.html#detecting-internationalization-support |
