Skip to content

Commit 9e5316c

Browse files
authored
fix(fetch): spec (#1295)
* fix(fetch): spec * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fiuxp * fixup * fixup * fiuxp * fiuxp * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup * fixup
1 parent 6ae0324 commit 9e5316c

5 files changed

Lines changed: 331 additions & 254 deletions

File tree

lib/fetch/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ const subresource = [
8686
''
8787
]
8888

89+
const corsSafeListedResponseHeaderNames = [] // TODO
90+
8991
module.exports = {
9092
subresource,
9193
forbiddenResponseHeaderNames,
94+
corsSafeListedResponseHeaderNames,
9295
forbiddenMethods,
9396
requestBodyHeader,
9497
referrerPolicy,

lib/fetch/headers.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,12 @@ class Headers {
346346
const callback = args[0]
347347
const thisArg = args[1]
348348

349-
for (let index = 0; index < this[kHeadersList].length; index += 2) {
349+
const clone = this[kHeadersList].slice()
350+
for (let index = 0; index < clone.length; index += 2) {
350351
callback.call(
351352
thisArg,
352-
this[kHeadersList][index + 1],
353-
this[kHeadersList][index],
353+
clone[index + 1],
354+
clone[index],
354355
this
355356
)
356357
}

0 commit comments

Comments
 (0)