summaryrefslogtreecommitdiff
path: root/ext/fetch/26_fetch.js
diff options
context:
space:
mode:
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.