rpmdevtools/77.patch
DistroBaker e9c97de256 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/rpmdevtools.git#26bfd64822198d5cc2f517736c2aeef41a0c9a14
2021-01-25 11:58:49 +00:00

34 lines
1.3 KiB
Diff

From 6a582f49fa958e4ba3e374d0e77d814524111dfb Mon Sep 17 00:00:00 2001
From: Miro Hrončok <miro@hroncok.cz>
Date: Jan 23 2021 13:15:35 +0000
Subject: Use Accept-Encoding: identity together with decode_content=False
This should fix both the issues:
- gzips decompressed: https://pagure.io/rpmdevtools/issue/72
- texts compressed: https://pagure.io/rpmdevtools/issue/76
$ file tor-0.4.5.4-rc.tar.gz tor-0.4.5.4-rc.tar.gz.asc xrootd-5.0.3.tar.gz
tor-0.4.5.4-rc.tar.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 35962880
tor-0.4.5.4-rc.tar.gz.asc: PGP signature Signature (old)
xrootd-5.0.3.tar.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 981462405
---
diff --git a/rpmdev-spectool b/rpmdev-spectool
index 56a2d43..a324fab 100755
--- a/rpmdev-spectool
+++ b/rpmdev-spectool
@@ -239,6 +239,9 @@ def download(url, target, headers=None, tracker: Optional[ProgressTracker] = Non
headers = {}
headers.setdefault("User-Agent", "rpmdev-spectool")
+ # identity should prevent servers from sending gzip-compressed text
+ # which would later not be decompressed because we set decode_content=False
+ headers.setdefault("Accept-Encoding", "identity")
ret = requests.get(url, headers=headers, stream=True)
ret.raise_for_status()