1
0
Fork 0

Revert "Merge v1.4.2 into master"

This commit is contained in:
Ludovic Fernandez 2017-11-15 18:18:03 +01:00 committed by Traefiker
parent 6fcab72ec7
commit 0c702b0b6b
18 changed files with 145 additions and 717 deletions

View file

@ -3,7 +3,6 @@ package middlewares
import (
"compress/gzip"
"net/http"
"strings"
"github.com/NYTimes/gziphandler"
"github.com/containous/traefik/log"
@ -14,12 +13,7 @@ type Compress struct{}
// ServerHTTP is a function used by Negroni
func (c *Compress) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
contentType := r.Header.Get("Content-Type")
if strings.HasPrefix(contentType, "application/grpc") {
next.ServeHTTP(rw, r)
} else {
gzipHandler(next).ServeHTTP(rw, r)
}
gzipHandler(next).ServeHTTP(rw, r)
}
func gzipHandler(h http.Handler) http.Handler {