go: net/http: Transport doesn't support deflate (and Twitter is broken)
What version of Go are you using (go version
)?
go version go1.7.4 linux/amd64
What operating system and processor architecture are you using (go env
)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build044368586=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
What did you do?
https://play.golang.org/p/ArzIv0uBlQ
What did you expect to see?
I see binary pre-decompression crap.
net/http doc says “If the Transport requests gzip on its own and gets a gzipped response, it’s transparently decoded in the Response.Body. However, if the user explicitly requested gzip it is not automatically uncompressed”.
I’m not requesting it, so it’s requested on its own.
What did you see instead?
I expect it to be decompressed, since I didn’t request compression.
I don’t know if this is because blog.twitter.com does something out of spec.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Automatically deflate based on Content-Encoding Twitter returns deflate data despite the client only requesting gzip data. net/http automatically handles the latter but not the former: https://githu... — committed to gaul/anaconda by gaul 7 years ago
- Automatically deflate based on Content-Encoding Twitter returns deflate data despite the client only requesting gzip data. net/http automatically handles the latter but not the former: https://githu... — committed to gaul/anaconda by gaul 7 years ago
- Automatically deflate based on Content-Encoding Twitter returns deflate data despite the client only requesting gzip data. net/http automatically handles the latter but not the former: https://githu... — committed to gaul/anaconda by gaul 7 years ago
- Automatically deflate based on Content-Encoding Twitter returns deflate data despite the client only requesting gzip data. net/http automatically handles the latter but not the former: https://githu... — committed to gaul/anaconda by gaul 7 years ago
- Automatically deflate based on Content-Encoding (#179) Twitter returns deflate data despite the client only requesting gzip data. net/http automatically handles the latter but not the former: http... — committed to ChimeraCoder/anaconda by gaul 7 years ago
@rsc @bradfitz this has been fixed, we now handle accept-encoding correctly.
@bradfitz I doubt Yuri or Antoine are listening in to this nowadays. @mosesn
@mosesn, thanks for the fix and update! Will close.
@rsc @bradfitz this is in flight, targeted for early January. sorry for the long delay, it fell off my plate for a bit. https://twittercommunity.com/t/improving-the-twitter-api-support-for-http-2/98728