Closed 1zilc closed 7 months ago
ProxyAgent causes headers.host to be forcibly reset in undici.request
ProxyAgent
headers.host
undici.request('http://127.0.0.1:8000', { headers: { host: 'test.com', }, dispatcher: new ProxyAgent({ uri: 'http://127.0.0.1:1087', }), });
request.headers.host should be test.com instead of 127.0.0.1:8000
request.headers.host
test.com
127.0.0.1:8000
macOS 14.4.0 node v20.11.0 undici 6.10.2
without proxy
undici.request('http://127.0.0.1:8000', { headers: { host: 'test.com', }, });
Thanks for the report, would you like to submit a PR for it?
I'd love to try and fix it.
Bug Description
ProxyAgent
causesheaders.host
to be forcibly reset in undici.requestReproducible By
Expected Behavior
request.headers.host
should betest.com
instead of127.0.0.1:8000
Logs & Screenshots
Environment
macOS 14.4.0 node v20.11.0 undici 6.10.2
Additional context
without proxy