proxy: force HttpRequest.Close to false when dropping hop-by-hop headers #100
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.
I suppose there is logic in HttpRequest to set the field when receiving
the header, but apparently it does not keep both in sync (or favor the
field). The tests were failing for me on OSX10 / Go 1.4.2 with:
--- FAIL: TestNoProxyHeaders (0.00s)
proxy_test.go:535: Got Connection header from goproxy map[Connection:[close] Accept-Encoding:[gzip] User-Agent:[Go 1.1 package http]]
--- FAIL: TestNoProxyHeadersHttps (0.27s)
proxy_test.go:535: Got Connection header from goproxy map[User-Agent:[Go 1.1 package http] Connection:[close] Accept-Encoding:[gzip]]
FAIL
FAIL github.com/elazarl/goproxy 2.428s
Probably fixed #92, which I noticed while submitting the PR.