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

ProxyAgent will cause customized host to reset #3019

Closed
1zilc opened this issue Mar 30, 2024 · 2 comments · Fixed by #3026
Closed

ProxyAgent will cause customized host to reset #3019

1zilc opened this issue Mar 30, 2024 · 2 comments · Fixed by #3026
Labels
bug Something isn't working

Comments

@1zilc
Copy link
Contributor

1zilc commented Mar 30, 2024

Bug Description

ProxyAgent causes headers.host to be forcibly reset in undici.request

Reproducible By

undici.request('http://127.0.0.1:8000', {
  headers: {
    host: 'test.com',
  },
  dispatcher: new ProxyAgent({
    uri: 'http://127.0.0.1:1087',
  }),
});

Expected Behavior

request.headers.host should be test.com instead of 127.0.0.1:8000

Logs & Screenshots

image

Environment

macOS 14.4.0
node v20.11.0
undici 6.10.2

Additional context

without proxy

undici.request('http://127.0.0.1:8000', {
  headers: {
    host: 'test.com',
  },
});
image
@1zilc 1zilc added the bug Something isn't working label Mar 30, 2024
@metcoder95
Copy link
Member

Thanks for the report, would you like to submit a PR for it?

@1zilc
Copy link
Contributor Author

1zilc commented Mar 31, 2024

I'd love to try and fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants