From 54bc55cd6649fdfe196ddff76d924ce25731c58c Mon Sep 17 00:00:00 2001 From: tsctx <91457664+tsctx@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:06:40 +0900 Subject: [PATCH] fetch: don't re-lowercase HeadersList --- lib/web/fetch/request.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/web/fetch/request.js b/lib/web/fetch/request.js index ca12576b1f0..60626f06a92 100644 --- a/lib/web/fetch/request.js +++ b/lib/web/fetch/request.js @@ -459,8 +459,9 @@ class Request { // 4. If headers is a Headers object, then for each header in its header // list, append header’s name/header’s value to this’s headers. if (headers instanceof HeadersList) { - for (const [key, val] of headers) { - headersList.append(key, val) + for (const { 0: key, 1: val } of headers) { + // Note: The header names are already in lowercase. + headersList.append(key, val, true) } // Note: Copy the `set-cookie` meta-data. headersList.cookies = headers.cookies