-
Notifications
You must be signed in to change notification settings - Fork 502
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 failed when setting host: header correctly #2318
Comments
Setting the host header to |
There's no way for the caller to predict www.bing.com since it's a dynamic redirect chosen by bing.com. |
It's an undici bug insofar as you allow setting forbidden headers. It works everywhere else (in the browser, on Cloudflare Workers) because the caller-supplied host is ignored as a forbidden header and the host: is filled in dynamically for each redirect. |
Like #1462 this comes up when using undici With browser |
So to clear some things up, neither Deno or CFW implement forbidden headers, they simply disallow setting only the |
@mcollina @KhafraDev I think there are valid usecases for setting the host header on a request in Node.js environment. We are running into this issue when upgrading from Node 18.17.1 to Node 20.8.1, as the host header doesn't seem to be passed along to the application anymore (thus, breaking the integration). Is this really the desired behavior? |
Reproducible By
The bug happens with bing.com because it tries to redirect to www.bing.com; it doesn't happen for domains that don't redirect, such as fanyi.baidu.com.
Environment
The text was updated successfully, but these errors were encountered: