We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since v6.16.1, undici sends the origin header as origin: https://origin.example.com, undefined in some cases.
origin: https://origin.example.com, undefined
This reproducibly happens when sending a POST request, with the origin header explicitly specified in headers and redirect: "error".
POST
headers
redirect: "error"
import { fetch } from 'undici'; async function repro() { let api_url = "http://localhost:8080"; let response = await fetch(api_url, { "headers": { "origin": "https://origin.example.com" }, "body": "", "method": "POST", "redirect": "error" }); } await repro();
I expected the origin header to be sent as origin: https://origin.example.com.
origin: https://origin.example.com
complete request sent with undici v6.16.1 and above:
POST / HTTP/1.1 host: localhost:8080 connection: keep-alive origin: https://origin.example.com, undefined content-type: text/plain;charset=UTF-8 accept: */* accept-language: * sec-fetch-mode: cors user-agent: undici accept-encoding: gzip, deflate content-length: 0
complete request sent with undici v6.16.0:
POST / HTTP/1.1 host: localhost:8080 connection: keep-alive origin: https://origin.example.com content-type: text/plain;charset=UTF-8 accept: */* accept-language: * sec-fetch-mode: cors user-agent: undici accept-encoding: gzip, deflate content-length: 0
Arch Linux, Node.js v22.3.0
The text was updated successfully, but these errors were encountered:
@KhafraDev
Sorry, something went wrong.
Caused by 0a66d30, will fix soon
Successfully merging a pull request may close this issue.
Bug Description
Since v6.16.1, undici sends the origin header as
origin: https://origin.example.com, undefined
in some cases.This reproducibly happens when sending a
POST
request, with the origin header explicitly specified inheaders
andredirect: "error"
.Reproducible By
Expected Behavior
I expected the origin header to be sent as
origin: https://origin.example.com
.Logs & Screenshots
complete request sent with undici v6.16.1 and above:
complete request sent with undici v6.16.0:
Environment
Arch Linux, Node.js v22.3.0
Additional context
The text was updated successfully, but these errors were encountered: