Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Node 18.18.2 Incorrectly copies headers onto fetches #2374

@bbowman

Description

@bbowman

Bug Description

Noticed that in our product using Node 18 that we encountered a slew of issues when moving forward to 18.18.2 that included a CVE fix for undici. Debugging into the issue it appears that in the CVE fix a class name was changed resulting in incorrect behavior. See the screenshot below and I believe it should be a simple fix. The headers copying logic fell down the wrong path when it failed to recognize that the passed in Object was already a Headers object.

Reproducible By

I dont have a minimal repro handy but it should be just creating a new Request with both an existing request with headers to copy and an init param.

Expected Behavior

When creating a new request with both a Request object to copy and an init set of options, the headers from the request are preserved.

Logs & Screenshots

image

Environment

Node v18.18.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions