nytimes / gziphandler

Go middleware to gzip HTTP responses
https://godoc.org/github.com/NYTimes/gziphandler
Apache License 2.0
868 stars 129 forks source link

Should Content-Length be set on gzipped responses? #84

Open tonyghita opened 5 years ago

tonyghita commented 5 years ago

I see that the Content-Length header is read when a response passes through the middleware, and that it is later deleted before writing the gzipped response to prevent the EOF.

Should a Content-Length header be set after the size of the compressed content is known? What are the reasons for omitting Content-Length on gzipped responses?

sourpotato commented 3 years ago

I have the same question.