From 688b19f1199bcae22a9d83977d7403a1cf8d4ef1 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Nov 08 2025 15:59:21 +0000 Subject: `sources`: set "Accept-Encoding: identity" header on HTTP requests Setting this header is always correct, even though it is not always necessary. But it is necessary *sometimes* to prevent servers from sending gz-compressed files in a way that causes them to get decompressed on-the-fly on download (i.e. "Content-Encoding: gz"). see also https://pagure.io/fedora-infrastructure/issue/12812 Signed-off-by: Fabio Valentini --- diff --git a/pyrpkg/lookaside.py b/pyrpkg/lookaside.py index 5929fc9..76b47d5 100644 --- a/pyrpkg/lookaside.py +++ b/pyrpkg/lookaside.py @@ -173,7 +173,7 @@ class CGILookasideCache(object): c = pycurl.Curl() c.setopt(pycurl.URL, url) - c.setopt(pycurl.HTTPHEADER, ['Pragma:']) + c.setopt(pycurl.HTTPHEADER, ['Pragma:', 'Accept-Encoding: identity']) c.setopt(pycurl.NOPROGRESS, False) c.setopt(pycurl.PROGRESSFUNCTION, self.print_progress) c.setopt(pycurl.OPT_FILETIME, True)