Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch request class headers from cloned request are not copied over which is inconsistent with browser #50490

Closed
calebmer opened this issue Oct 31, 2023 · 1 comment

Comments

@calebmer
Copy link

calebmer commented Oct 31, 2023

Version

20.9.0

Platform

Darwin Calebs-MBP-2 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000 arm64

Subsystem

undici

What steps will reproduce the bug?

const request1 = new Request('localhost:3000', {method: 'POST', headers: {a: 'b'}});
request1.headers.get('a'); // Ok: 'b'

const request2 = new Request(request1, {method: 'GET'});
request2.headers.get('a'); // Node.js returns null, Chrome returns 'b'

How often does it reproduce? Is there a required condition?

Reproduces 100% of the time

What is the expected behavior? Why is that the expected behavior?

Expected behavior is request2.headers.get('a') returns 'b' like the browser.

What do you see instead?

request2.headers.get('a') returns null.

Additional information

No response

@KhafraDev
Copy link
Member

duplicate of #50263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants