Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Disabling response body compression #86

Closed
tomjack opened this Issue Feb 13, 2013 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

tomjack commented Feb 13, 2013

Should the use of HttpContentCompressor be configurable via some option?

I'm implementing an EventSource server. Chrome at least will send "Accept-Encoding: gzip, ...", and HttpContentCompressor automatically obliges, apparently no matter what Content-Encoding header I return in my response. gzipping naturally breaks the EventSource, though. I've got it working for now by manually removing the HttpContentCompressor: https://github.com/loku/aleph/commit/c9146612d132af86d61a675dd60a84afe8dddef4

Owner

ztellman commented Feb 14, 2013

You can accomplish the same thing without forking the project, via the :pipeline-transform option. If you just add:

{:netty {:pipeline-transform #(.remove % "deflater")}}

to your server options, you'll accomplish the same thing. This isn't ideal, though, I'll think about how to better expose this option.

Contributor

tomjack commented Feb 14, 2013

Great, thanks! I noticed pipeline-transform while trying to find a relevant option, but had no clue how to use it.

Owner

ztellman commented Feb 14, 2013

Sorry, the above code isn't quite correct. Since that's meant to be a function that takes and returns a pipeline, that should be:

{:netty {:pipeline-transform #(doto % (.remove "deflater"))}}

@ztellman ztellman closed this Mar 13, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment