Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Latest commit

 

History

History
21 lines (14 loc) · 596 Bytes

File metadata and controls

21 lines (14 loc) · 596 Bytes

Minimal example for double gzip by gorilla/handlers.CompressHandler

The CompressHandler of gorilla/handlers gzips responses twice if they're already gzipped, i.e. it ignores the Content-Encoding header.

How to reproduce

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.