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

proxy: use the same data for CONNECT and Host header #967

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

nikstur
Copy link
Contributor

@nikstur nikstur commented Jan 29, 2025

The CONNECT and Host header should both point to the proxied host that we want to eventually reach, not to the proxy itself.

I'm no expert on proxies but MDN suggest that these headers should use the same data: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT

Also I used to be able to send proxied requests via socat to an Nginx with ureq < 3.0.0 and now it doesn't work anymore. socat now forwards the HTTP request as is to Nginx (telling me it doesn't recognize it as a valid proxy request) and Nginx replies with a 400. In previous ureq versions the CONNECT and Host headers used the same data: https://github.com/algesten/ureq/blob/2.12.1/src/proxy.rs#L187

The CONNECT and Host header should both point to the proxied host that
we want to eventually reach, not to the proxy itself.
@algesten
Copy link
Owner

Thanks!

This was a last minute change I did thinking "it must surely be the proxy host". And I realise now I did no googling on that.

@algesten algesten merged commit 89d593c into algesten:main Jan 30, 2025
34 checks passed
@nikstur nikstur deleted the proxy-header branch January 30, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants