-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
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.