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

Minimum size not compatible with template package #31

Closed alexandrestein closed 7 years ago

alexandrestein commented 7 years ago

The problem comes from the size limitation.

If the template package is used, it can calls Write multiple times with variable length. In any case the response writer must be the same for the all response inside the same request. So the package as is, is not good.

I made some modifications to prevent using different response writers on successive calls.

But the size limitation become pretty pointless with template or other handlers calling multiple times the Write function.

alexandrestein commented 7 years ago

Reopen with pull request. Sorry for the nose.