mirror of
https://github.com/denoland/deno.git
synced 2025-09-29 13:44:47 +00:00
fix(op_crate/fetch): infinite loop on fill headers (#10406)
Fixes a pesky bug in the fetch implementation where if the init part is specified in `fetch` instead of the `Request` constructor, the fillHeaders function receives two references to the same object, causing it to append to the same list being iterated over.
This commit is contained in:
parent
0ac2a17a0f
commit
a50dab683f
2 changed files with 20 additions and 2 deletions
|
@ -247,11 +247,14 @@
|
|||
|
||||
// 31.
|
||||
if (Object.keys(init).length > 0) {
|
||||
let headers = headerListFromHeaders(this[_headers]);
|
||||
let headers = headerListFromHeaders(this[_headers]).slice(
|
||||
0,
|
||||
headerListFromHeaders(this[_headers]).length,
|
||||
);
|
||||
if (init.headers !== undefined) {
|
||||
headers = init.headers;
|
||||
}
|
||||
headerListFromHeaders(this[_headers]).slice(
|
||||
headerListFromHeaders(this[_headers]).splice(
|
||||
0,
|
||||
headerListFromHeaders(this[_headers]).length,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue