From 55833cf799979e63c6b027fbbf018272308caf5c Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Wed, 1 Mar 2023 08:14:16 +0900 Subject: fix(core): introduce `SafeRegExp` to primordials (#17592) --- ext/fetch/20_headers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext/fetch/20_headers.js') diff --git a/ext/fetch/20_headers.js b/ext/fetch/20_headers.js index b8fd8ab83..a432e76f4 100644 --- a/ext/fetch/20_headers.js +++ b/ext/fetch/20_headers.js @@ -32,6 +32,7 @@ const { ObjectEntries, RegExpPrototypeTest, SafeArrayIterator, + SafeRegExp, Symbol, SymbolFor, SymbolIterator, @@ -88,7 +89,7 @@ function fillHeaders(headers, object) { // Regex matching illegal chars in a header value // deno-lint-ignore no-control-regex -const ILLEGAL_VALUE_CHARS = /[\x00\x0A\x0D]/; +const ILLEGAL_VALUE_CHARS = new SafeRegExp(/[\x00\x0A\x0D]/); /** * https://fetch.spec.whatwg.org/#concept-headers-append -- cgit v1.2.3