Skip to content

Commit 2188616

Browse files
benitogfBenito
andauthored
skip compression on upgrade connection (#187)
* skip compression on upgrade connection * cleaner check Co-authored-by: Benito <benito.gomez@idnerd.com>
1 parent ccebae9 commit 2188616

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compress.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ func CompressHandlerLevel(h http.Handler, level int) http.Handler {
102102
return
103103
}
104104

105+
if r.Header.Get("Upgrade") != "" {
106+
h.ServeHTTP(w, r)
107+
return
108+
}
109+
105110
// wrap the ResponseWriter with the writer for the chosen encoding
106111
var encWriter io.WriteCloser
107112
if encoding == gzipEncoding {

0 commit comments

Comments
 (0)