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

http.DefaultTransport mutates the http.Request #2140

Closed
gopherbot opened this issue Aug 8, 2011 · 4 comments
Closed

http.DefaultTransport mutates the http.Request #2140

gopherbot opened this issue Aug 8, 2011 · 4 comments

Comments

@gopherbot
Copy link
Contributor

by dgrijalva@ngmoco.com:

What steps will reproduce the problem?
1. use the DefaultTransport's RoundTrip method with an http.Request that does not have
the Accept-Encoding header
2. check the Accept-Encoding header after the round trip
3.

What is the expected output?
the Accept-Encoding header should be unmodified

What do you see instead?
the Accept-Encoding header is set to "gzip"

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
mac, ubuntu

Which revision are you using?  (hg identify)
bb28251f6da4+ weekly/weekly.2011-07-29

Please provide any additional information below.

The default round tripper (cleverly) uses gzip encoding transparently when making
upstream requests for a client that doesn't support compression.  The trouble is that it
mutates the http.Request struct and doesn't put it back.  This breaks any software that
looks at the request after performing the round trip.
@gopherbot
Copy link
Contributor Author

Comment 1 by dgrijalva@ngmoco.com:

Patch submitted at http://golang.org/cl/4857041

@robpike
Copy link
Contributor

robpike commented Aug 9, 2011

Comment 2:

Owner changed to @bradfitz.

@robpike
Copy link
Contributor

robpike commented Aug 9, 2011

Comment 3:

Status changed to Accepted.

@bradfitz
Copy link
Contributor

Comment 4:

This issue was closed by revision 8f3c749.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants