stretchr / goweb

A lightweight RESTful web framework for Go
632 stars 61 forks source link

Gzip Compression #73

Closed nemosupremo closed 10 years ago

nemosupremo commented 10 years ago

Is there a kosher way of adding gzip compressed responses to goweb?

tobz commented 10 years ago

You could instantiate the HTTP handler (handlers.HttpHandler) object yourself, and use something like this to wrap it: http://nf.id.au/posts/2011/04/roll-your-own-gzip-encoded-http-handler.html

tobz commented 10 years ago

It also bears mentioning, though: if you're developing a secure site with that this, you're potentially opening yourself up to the BREACH attack by using compression and SSL together. It depends on a number of circumstances, though, which you could prime yourself on at: http://breachattack.com/

nemosupremo commented 10 years ago

Okay, thanks.