From e842b2d6903a0f47095297fcf7bb7dd0655601fc Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 17 Nov 2021 10:05:01 -0600 Subject: [PATCH 1/2] fix: Allow for both tar and zip headers Co-authored-by: Graeme Watt --- src/pyhf/contrib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyhf/contrib/utils.py b/src/pyhf/contrib/utils.py index 7d7dd1a744..14061dcf9d 100644 --- a/src/pyhf/contrib/utils.py +++ b/src/pyhf/contrib/utils.py @@ -69,7 +69,7 @@ def download(archive_url, output_directory, force=False, compress=False): # TODO: Figure out how to accept headers of both application/x-tar and # application/zip. with requests.get( - archive_url, headers={"Accept": "application/x-tar"} + archive_url, headers={"Accept": "application/x-tar, application/zip"} ) as response: if response.status_code != 200: raise exceptions.InvalidArchive( From c9cf7c02ca7e7fa48564fab74f832909f717cb81 Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Wed, 17 Nov 2021 10:05:55 -0600 Subject: [PATCH 2/2] Remove note --- src/pyhf/contrib/utils.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pyhf/contrib/utils.py b/src/pyhf/contrib/utils.py index 14061dcf9d..b8d3d11023 100644 --- a/src/pyhf/contrib/utils.py +++ b/src/pyhf/contrib/utils.py @@ -66,8 +66,6 @@ def download(archive_url, output_directory, force=False, compress=False): # The HEPData landing page for the resource file can check if the Accept # request HTTP header matches the content type of the resource file and # return the content directly if so. - # TODO: Figure out how to accept headers of both application/x-tar and - # application/zip. with requests.get( archive_url, headers={"Accept": "application/x-tar, application/zip"} ) as response: