Possibly related to Go: Detect gzip encoding to manually decompress response, but 'Content-Encoding' header missing
I understand that net/http Transport will add Accept-Encoding: gzip
to a request unless DisableCompression
is set to True, and that is required if I want it to automatically decompress a gzipped response. That being the case, the following code does not receive a Content-Encoding: gzip
header:
https://play.golang.org/p/FWs5uG9pZEL (note: will not run in the playground due to network constraints)
If I run a local server and run the above code with it I can see the expected header being sent:
GET / HTTP/1.1
Host: localhost:5555
User-Agent: Go-http-client/1.1
Accept-Encoding: gzip
Is there something else about the connection go creates that is causing the server not to return a gzipped response?