Skip to content

Expose CURLOPT_HEADEROPT: proxy_headers_separate - #690

Open
CarloTUM wants to merge 1 commit into
sagebind:mainfrom
CarloTUM:header-opt
Open

CarloTUM wants to merge 1 commit into
sagebind:mainfrom
CarloTUM:header-opt

Conversation

@CarloTUM

Copy link
Copy Markdown

proxy_headers() has been a no-op so far: libcurl only reads CURLOPT_PROXYHEADER when CURLOPT_HEADEROPT is CURLHEADER_SEPARATE, and the crate never set that. In the default unified mode libcurl also sends the http_headers list to the proxy in CONNECT requests, so an Authorization or Cookie header meant for the origin reaches the proxy.

This adds Easy::proxy_headers_separate(bool) (and on Easy2), the CURLOPT_HEADEROPT constant and the two CURLHEADER_* values, and points the proxy_headers docs 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.

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

No deployments
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.

1 participant