From 0093ee3cd904bfb0d363c1b64f09630e61ec3fd0 Mon Sep 17 00:00:00 2001 From: faceair Date: Sat, 17 Oct 2020 05:32:34 -0500 Subject: [PATCH] disable response compression on websocket (#841) --- lib/httpserver/httpserver.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/httpserver/httpserver.go b/lib/httpserver/httpserver.go index e29f5765de..6a0efbbefb 100644 --- a/lib/httpserver/httpserver.go +++ b/lib/httpserver/httpserver.go @@ -276,6 +276,9 @@ func maybeGzipResponseWriter(w http.ResponseWriter, r *http.Request) http.Respon if *disableResponseCompression { return w } + if r.Header.Get("Connection") == "Upgrade" { + return w + } ae := r.Header.Get("Accept-Encoding") if ae == "" { return w