Go version
go version go1.22.3 linux/amd64
Output of go env
in your module/workspace:
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.3'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD=''
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2220463238=/tmp/go-build -gno-record-gcc-switches'
What did you do?
https://go.dev/play/p/_NfjqtCTPvI
What did you see happen?
panic: Get "http://127.0.0.1:27417": net/http: HTTP/1.x transport connection broken: too many transfer encodings: ["gzip" "chunked"]
What did you expect to see?
I expected it to handle Transfer-Encoding: gzip
.
The Go 1.23 release notes contain:
On-the-fly compression should use the Transfer-Encoding header instead of Content-Encoding.
However, it doesn't appear that Go supports that.
Comment From: gabyhelp
Related Issues and Documentation
- net/http: support "gzip" as a Transfer Encoding #29162
- net/http: Transport doesn't support specify Transfer-Encoding explicitly #33733 (closed)
- net/http: Transfer-Encoding header is missing in headers (http.Request) #27061
- net/http: Transfer-Encoding: chunked is sometimes used when making HTTP2 requests #43303 (closed)
- x/net/http2: gzip response not decoded #40774 (closed)
- net/http: Transport doesn't support deflate (and Twitter is broken) #18779 (closed)
- net/http: Server removes all explicitly set `Transfer-Encoding` headers #16063 (closed)
- net/http: HTTP transport automatic unzipping appears to not properly work if Content-Encoding reply header isn't lowercase gzip #19248 (closed)
- net/http: Server sets both Content-Length \& Transfer-Encoding: chunked #9987 (closed)
- net/http: `Content-Length` values are not validated when `Transfer-Encoding: chunked` is present #65505 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: jameshartig
I believe this is a duplicate of https://github.com/golang/go/issues/29162. I didn't find it in search because I searched "Transfer-Encoding". Apologies.