Skip to content

Commit f25b8dd

Browse files
fix: Accept tar and zip headers in contrib.utils.download requests (#1704)
* Add zip headers to the accepted content headers for contrib.utils.download * Amends PR #1697 Co-authored-by: Graeme Watt <[email protected]>
1 parent d4b2d9c commit f25b8dd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/pyhf/contrib/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ def download(archive_url, output_directory, force=False, compress=False):
6666
# The HEPData landing page for the resource file can check if the Accept
6767
# request HTTP header matches the content type of the resource file and
6868
# return the content directly if so.
69-
# TODO: Figure out how to accept headers of both application/x-tar and
70-
# application/zip.
7169
with requests.get(
72-
archive_url, headers={"Accept": "application/x-tar"}
70+
archive_url, headers={"Accept": "application/x-tar, application/zip"}
7371
) as response:
7472
if response.status_code != 200:
7573
raise exceptions.InvalidArchive(

0 commit comments

Comments
 (0)