Skip to content

Commit

Permalink
Do not compress when content type text/event-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Rabot committed Jul 18, 2019
1 parent 06df601 commit 3a2b08f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/middlewares/compress/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func (c *compress) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
contentType := req.Header.Get("Content-Type")
if strings.HasPrefix(contentType, "application/grpc") {
c.next.ServeHTTP(rw, req)
} else if strings.HasPrefix(contentType, "text/event-stream") {
c.next.ServeHTTP(rw, req)
} else {
gzipHandler(c.next, middlewares.GetLogger(req.Context(), c.name, typeName)).ServeHTTP(rw, req)
}
Expand Down

0 comments on commit 3a2b08f

Please sign in to comment.