fix(core): introduce SafeRegExp to primordials (#17592)

This commit is contained in:
Kenta Moriuchi 2023-03-01 08:14:16 +09:00 committed by GitHub
parent 6ffbf8a941
commit 55833cf799
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 171 additions and 60 deletions

View file

@ -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