We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e13b83 commit 6315923Copy full SHA for 6315923
gzhttp/gzip.go
@@ -558,7 +558,11 @@ func ContentTypeFilter(compress func(ct string) bool) option {
558
// acceptsGzip returns true if the given HTTP request indicates that it will
559
// accept a gzipped response.
560
func acceptsGzip(r *http.Request) bool {
561
- return parseEncodingGzip(r.Header.Get(acceptEncoding)) > 0
+ // Note that we don't request this for HEAD requests,
562
+ // due to a bug in nginx:
563
+ // https://trac.nginx.org/nginx/ticket/358
564
+ // https://golang.org/issue/5522
565
+ return r.Method != http.MethodHead && parseEncodingGzip(r.Header.Get(acceptEncoding)) > 0
566
}
567
568
// returns true if we've been configured to compress the specific content type.
0 commit comments