summaryrefslogtreecommitdiff
path: root/ext/fetch/26_fetch.js
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2021-11-23 01:23:11 +0100
committerGitHub <noreply@github.com>2021-11-23 01:23:11 +0100
commit2eae1ae665ff601b86e936ad9d80cfa57831ce88 (patch)
treeef8cd9e645ae3a67dbd785f93bbc40a3b57d633a /ext/fetch/26_fetch.js
parent210300d0497005f74d64a1d028e1becbae9f27e8 (diff)
revert: store header keys lower case internally (#12837)
This reverts commit 49ec3d10ad90851f4d28274a3f0fe96c642204ac.
Diffstat (limited to 'ext/fetch/26_fetch.js')
-rw-r--r--ext/fetch/26_fetch.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js
index f15e7f6b9..47d8b2e85 100644
--- a/ext/fetch/26_fetch.js
+++ b/ext/fetch/26_fetch.js
@@ -14,6 +14,7 @@
((window) => {
const core = window.Deno.core;
const webidl = window.__bootstrap.webidl;
+ const { byteLowerCase } = window.__bootstrap.infra;
const { errorReadableStream } = window.__bootstrap.streams;
const { InnerBody, extractBody } = window.__bootstrap.fetchBody;
const {
@@ -331,7 +332,7 @@
function httpRedirectFetch(request, response, terminator) {
const locationHeaders = ArrayPrototypeFilter(
response.headerList,
- (entry) => entry[0] === "location",
+ (entry) => byteLowerCase(entry[0]) === "location",
);
if (locationHeaders.length === 0) {
return response;
@@ -372,7 +373,7 @@
if (
ArrayPrototypeIncludes(
REQUEST_BODY_HEADER_NAMES,
- request.headerList[i][0],
+ byteLowerCase(request.headerList[i][0]),
)
) {
ArrayPrototypeSplice(request.headerList, i, 1);
@@ -418,8 +419,8 @@
}
requestObject.signal[abortSignal.add](onabort);
- if (!requestObject.headers.has("accept")) {
- ArrayPrototypePush(request.headerList, ["accept", "*/*"]);
+ if (!requestObject.headers.has("Accept")) {
+ ArrayPrototypePush(request.headerList, ["Accept", "*/*"]);
}
// 12.