traefik/middlewares/compress.go
2016-09-28 23:04:18 +01:00

17 lines
339 B
Go

package middlewares
import (
"github.com/NYTimes/gziphandler"
"net/http"
)
// Rewrite is a middleware that allows redirections
type Compress struct {
}
//
func (_ *Compress) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
newGzipHandler := gziphandler.GzipHandler(next)
newGzipHandler.ServeHTTP(rw, r)
}