diff options
| author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2022-06-27 17:16:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-27 17:16:06 +0200 |
| commit | a055337a027cf52f6cd4c19eb80144ab99b00b58 (patch) | |
| tree | 905b8ad9b48163e8dcf7e7f14c8985a2ee58eae5 /lib/internal/http2 | |
| parent | 411fb2172314588a6503f8f7aa14263b117c04df (diff) | |
| download | node-new-a055337a027cf52f6cd4c19eb80144ab99b00b58.tar.gz | |
lib: refactor to avoid unsafe regex primordials
PR-URL: https://github.com/nodejs/node/pull/43475
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Diffstat (limited to 'lib/internal/http2')
| -rw-r--r-- | lib/internal/http2/core.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 22d9f0f6c0..7934675bea 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -23,7 +23,7 @@ const { ReflectGet, ReflectGetPrototypeOf, ReflectSet, - RegExpPrototypeTest, + RegExpPrototypeExec, SafeArrayIterator, SafeMap, SafeSet, @@ -1665,7 +1665,7 @@ class ServerHttp2Session extends Http2Session { } validateString(alt, 'alt'); - if (!RegExpPrototypeTest(kQuotedString, alt)) + if (RegExpPrototypeExec(kQuotedString, alt) === null) throw new ERR_INVALID_CHAR('alt'); // Max length permitted for ALTSVC |
