This commit is contained in:
tuier 2016-09-28 22:29:27 +01:00
parent 17546c3a08
commit a58750992d
2 changed files with 3 additions and 4 deletions

View file

@ -5,12 +5,12 @@ import (
"net/http"
)
// Rewrite is a middleware that allows redirections
// Compress is a middleware that allows redirections
type Compress struct {
}
//
func (_ *Compress) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
// ServerHTTP is a function used by negroni
func (c *Compress) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
newGzipHandler := gziphandler.GzipHandler(next)
newGzipHandler.ServeHTTP(rw, r)
}