The CompressHandler
of gorilla/handlers gzips responses twice if they're already gzipped, i.e. it ignores the Content-Encoding
header.
Requirements:
- go 1.12+
$ go run main.go &
$ curl -H 'Accept-Encoding: gzip' localhost:9999 | gunzip
# prints garbage
$ curl -H 'Accept-Encoding: gzip' localhost:9999 | gunzip | gunzip
# works fine
A working implementation is served on localhost:19999
.