Skip to content

Commit

Permalink
Merge branch 'main' into deno_bump
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Aug 12, 2023
2 parents 24630d5 + 396498b commit e6a0af4
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions ext/fetch/23_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,20 +366,16 @@ class Request {
this[_headers] = headersFromHeaderList(request.headerList, "request");

// 32.
if (ObjectKeys(init).length > 0) {
let headers = ArrayPrototypeSlice(
headerListFromHeaders(this[_headers]),
if (init.headers || ObjectKeys(init).length > 0) {
const headerList = headerListFromHeaders(this[_headers]);
const headers = init.headers ?? ArrayPrototypeSlice(
headerList,
0,
headerListFromHeaders(this[_headers]).length,
headerList.length,
);
if (init.headers !== undefined) {
headers = init.headers;
if (headerList.length !== 0) {
ArrayPrototypeSplice(headerList, 0, headerList.length);
}
ArrayPrototypeSplice(
headerListFromHeaders(this[_headers]),
0,
headerListFromHeaders(this[_headers]).length,
);
fillHeaders(this[_headers], headers);
}

Expand Down

0 comments on commit e6a0af4

Please sign in to comment.