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

Adding fixes to a bug introduced with PR #16 #19

Closed jprobinson closed 8 years ago

jprobinson commented 8 years ago

PR #16 broke the middleware for users who call WriteHeader within their handlers before writing the response body.

This PR changes the tests to properly test http.ResponseWriter header and it also changes the logic from PR #16 to only allow empty responses if the status code is 204 or 304.