Repository navigation
Conversation
Without it proxy_headers() is dead: libcurl ignores CURLOPT_PROXYHEADER in its default unified mode, and in that mode it also sends the http_headers list to the proxy in CONNECT requests, Authorization and Cookie included. proxy_headers_separate(true) selects CURLHEADER_SEPARATE. The test runs a plain-http proxy and checks which lists arrive in each mode.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
proxy_headers()has been a no-op so far: libcurl only readsCURLOPT_PROXYHEADERwhenCURLOPT_HEADEROPTisCURLHEADER_SEPARATE, and the crate never set that. In the default unified mode libcurl also sends thehttp_headerslist to the proxy inCONNECTrequests, so anAuthorizationorCookieheader meant for the origin reaches the proxy.This adds
Easy::proxy_headers_separate(bool)(and onEasy2), theCURLOPT_HEADEROPTconstant and the twoCURLHEADER_*values, and points theproxy_headersdocs at it. A test runs the test server as a plain-http proxy and checks that the proxy list only arrives once the mode is on.Found while wiring proxy authentication in a crate on top of this one; independent of #687, #688 and #689.