summaryrefslogtreecommitdiff
path: root/ext/fetch/20_headers.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fetch/20_headers.js')
-rw-r--r--ext/fetch/20_headers.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/fetch/20_headers.js b/ext/fetch/20_headers.js
index ae32aec11..c4a919807 100644
--- a/ext/fetch/20_headers.js
+++ b/ext/fetch/20_headers.js
@@ -68,7 +68,7 @@
*/
function fillHeaders(headers, object) {
if (ArrayIsArray(object)) {
- for (const header of object) {
+ for (const header of new SafeArrayIterator(object)) {
if (header.length !== 2) {
throw new TypeError(
`Invalid header. Length must be 2, but is ${header.length}`,
@@ -205,7 +205,7 @@
// spec but produce the same result.
const headers = {};
const cookies = [];
- for (const entry of list) {
+ for (const entry of new SafeArrayIterator(list)) {
const name = byteLowerCase(entry[0]);
const value = entry[1];
if (value === null) throw new TypeError("Unreachable");
@@ -405,6 +405,7 @@
[SymbolFor("Deno.privateCustomInspect")](inspect) {
const headers = {};
+ // deno-lint-ignore prefer-primordials
for (const header of this) {
headers[header[0]] = header[1];
}