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

This is a minimal working example to demonstrate the gorilla/handlers.CompressHandlers gzips twice.

License

Notifications You must be signed in to change notification settings

spreadshirt/gorilla-handlers-double-gzip-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This is a minimal working example to demonstrate the gorilla/handlers.CompressHandlers gzips twice.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages