diff --git a/src/context.ts b/src/context.ts index 7acab14f..a23942e0 100644 --- a/src/context.ts +++ b/src/context.ts @@ -266,7 +266,10 @@ export const TEXT_PLAIN = 'text/plain; charset=UTF-8' * @returns The updated Headers object. */ const setHeaders = (headers: Headers, map: Record = {}) => { - Object.entries(map).forEach(([key, value]) => headers.set(key, value)) + for (let i = 0, keys = Object.keys(map), len = keys.length; i < len; i++) { + const key = keys[i] + headers.set(key, map[key]) + } return headers }