Skip to content

Commit

Permalink
skip compression on upgrade connection (#187)
Browse files Browse the repository at this point in the history
* skip compression on upgrade connection

* cleaner check

Co-authored-by: Benito <[email protected]>
  • Loading branch information
benitogf and Benito authored Aug 19, 2020
1 parent ccebae9 commit 2188616
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ func CompressHandlerLevel(h http.Handler, level int) http.Handler {
return
}

if r.Header.Get("Upgrade") != "" {
h.ServeHTTP(w, r)
return
}

// wrap the ResponseWriter with the writer for the chosen encoding
var encWriter io.WriteCloser
if encoding == gzipEncoding {
Expand Down

0 comments on commit 2188616

Please sign in to comment.