ant0ine/go-json-rest — pull request #96 by ant0ine (2014-11-09 02:25:34+00:00)
Title: Make the gzip middleware work with streamed responses

I realized that the gzip middleware was not working with the streamed responses.

Step to reproduce:
* take the streaming example from here:
https://github.com/ant0ine/go-json-rest-examples/tree/master/streaming
* enable gzip compression with: "EnableGzip: true," in the resource handler.
* go run streaming/main.go
* curl --compressed -i http://127.0.0.1:8080/stream

This change instantiates only one gzip writer per response writer,
and flushes it after each write.