Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Accept tar and zip headers in contrib.utils.download requests #1704

Merged
merged 2 commits into from
Nov 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/pyhf/contrib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ 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"}
archive_url, headers={"Accept": "application/x-tar, application/zip"}
) as response:
if response.status_code != 200:
raise exceptions.InvalidArchive(
Expand Down