-
-
Notifications
You must be signed in to change notification settings - Fork 35k
Closed
Labels
fetchIssues and PRs related to the Fetch APIIssues and PRs related to the Fetch API
Description
Version
v18.18.2
Platform
Linux hostname 5.15.131-1-MANJARO #1 SMP PREEMPT Thu Sep 7 11:05:18 UTC 2023 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
fetch("https://postman-echo.com/get", {
headers: {
Test: 1234,
Host: "foo.postman-echo.com",
},
})
.then((r) => {
return r.text();
})
.then((text) => console.log(text))
.catch((e) => {
console.log(e);
});run this code
The test works successfullty with v18.18.0 & v18.18.0
How often does it reproduce? Is there a required condition?
ive run the tests numerous times
the only condition I know is to run with v18.18.2
What is the expected behavior? Why is that the expected behavior?
- should send a request topostman-echo.com but should override the
Hosttofoo.postman-echo.comHeader - the reason: this is how a http client should behave
- see vor example:
curl -H 'Host: foobar.com' https://postman-echo.com/get
What do you see instead?
- the host header has not been overidden by the headers config
- the initial set host in the request url is taken
Additional information
- this was also tested in several docker images
- node:18-alpine (contains bug)
- node:18.18.2-alpine (contains bug)
- node:18.18.2-alpine (no bug)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
fetchIssues and PRs related to the Fetch APIIssues and PRs related to the Fetch API