Skip to content

Commit

Permalink
services: disable transport compression in matcher
Browse files Browse the repository at this point in the history
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 <hdonnay@redhat.com>
(cherry picked from commit b3e490d)
  • Loading branch information
hdonnay committed Jun 15, 2021
1 parent 6528f73 commit bc60dcc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions initialize/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit bc60dcc

Please sign in to comment.