diff --git a/.changeset/selfish-cameras-sort.md b/.changeset/selfish-cameras-sort.md new file mode 100644 index 0000000..d96bf41 --- /dev/null +++ b/.changeset/selfish-cameras-sort.md @@ -0,0 +1,5 @@ +--- +'@p-j/eapi-middleware-headers': patch +--- + +replace headers.forEach by for...of headers.entries() diff --git a/packages/eapi-middleware-headers/src/withHeaders.ts b/packages/eapi-middleware-headers/src/withHeaders.ts index 747d9aa..0a95635 100644 --- a/packages/eapi-middleware-headers/src/withHeaders.ts +++ b/packages/eapi-middleware-headers/src/withHeaders.ts @@ -75,7 +75,7 @@ export function manageHeaders({ if (addHeaders) { const headers = new Headers(addHeaders) - headers.forEach((value, header) => { + for (let [header, value] of headers.entries()) { const values = parseHeaderValues(value) const originalValues = parseHeaderValues(subject.headers.get(header) || '') @@ -98,7 +98,7 @@ export function manageHeaders({ break } } - }) + } } removeHeaders.forEach((header) => subject.headers.delete(header))