Skip to content

net/http: serveError removes "Content-Encoding" which breaks our system (GODEBUG=httpservecontentkeepheaders=0) #71138

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

Closed
martinrode opened this issue Jan 6, 2025 · 5 comments

Comments

@martinrode
Copy link

Go version

go version go1.23.2 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='arm64'
GOBIN='/Users/martin/go/bin'
GOCACHE='/Users/martin/Library/Caches/go-build'
GOENV='/Users/martin/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/martin/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/martin/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/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/martin/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/martin/go/src/github.com/programmfabrik/fylr/go.mod'
GOWORK='/Users/martin/go/src/github.com/programmfabrik/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/4f/l31kb4n521d6g89qxrwcx69h0000gp/T/go-build1664119454=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

We serve simple web pages using a compress handler (middleware).

This handler sets the header "Content-Encoding" to "gzip" if requested. If the served page ends up in a 404 and is served via net/http.serveError, the newly introduced deletion of http headers breaks the output of our system.

What did you see happen?

"Content-Encoding" header gets removed, but our content is still gzipped..

What did you expect to see?

I can see a reason why Cache-Control, Etag and Last-Modified makes sense to delete, but I don't see a reason to reset "Content-Encoding", but please remove the "Content-Encoding" from the list of deleted headers in net/http.serverError.

@seankhliao
Copy link
Member

see the discussion on #66343

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2025
@martinrode
Copy link
Author

I must object to closing this ticket. I described our problem in more detail here: #66343 (comment).

@martinrode
Copy link
Author

Sorry, but I re-opened a new ticket (with improved reasoning). This change is a breaking change and really harms: #71138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants