You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments