Implements proxy_headers method to add headers only to the proxy. #626
+19
−9
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.
This PR re-enables the
proxy_headers
method (see https://curl.se/libcurl/c/CURLOPT_PROXYHEADER.html available since curl 7.37.0)It is basically the same code as
http_headers
.The rational for this PR is to be used in Hurl, a cli HTTP engine powered by
curl-rust
. Hurl exposes various curl commands, basically delegating everything tocurl-rust/libcurl
and adding some syntax to test HTTP responses. One issue Orange-OpenSource/hurl#3944 and one draft PR Orange-OpenSource/hurl#4482 needs to use this new method exposed bycurl-rust
.To test it, I've used this sample:
And with mitmproxy:
We can see that only "All: bar" header is sent to the target :