From bc60dcc29d4440636f68911e79b08b188ac8e81e Mon Sep 17 00:00:00 2001 From: Hank Donnay Date: Tue, 15 Jun 2021 12:50:19 -0500 Subject: [PATCH] services: disable transport compression in matcher Some servers (e.g. Github) return weak HTTP validators when the Content-Encoding is not "identity". This disables automatically negotiating compression, which breaks Updaters' conditional requests. Signed-off-by: Hank Donnay (cherry picked from commit b3e490dbc1022a5d08f7ceef8565928fdd19be98) --- initialize/services.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/initialize/services.go b/initialize/services.go index 8c4bedb590..2945f4d5a2 100644 --- a/initialize/services.go +++ b/initialize/services.go @@ -187,6 +187,9 @@ func localMatcher(ctx context.Context, cfg *config.Config) (matcher.Service, err } tr := http.DefaultTransport.(*http.Transport).Clone() + // Some servers return weak validators when the Content-Encoding is not + // "identity". Setting this prevents automatically negotiating up to "gzip". + tr.DisableCompression = true jar, err := cookiejar.New(&cookiejar.Options{ PublicSuffixList: publicsuffix.List, })