Skip to content

Commit

Permalink
GH-564: identify as Flair
Browse files Browse the repository at this point in the history
  • Loading branch information
aakbik committed May 27, 2019
1 parent 9f777cb commit 5b728fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flair/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_from_cache(url: str, cache_dir: Path = None) -> Path:
return cache_path

# make HEAD request to check ETag
response = requests.head(url)
response = requests.head(url, headers={"User-Agent": "Flair"})
if response.status_code != 200:
raise IOError(
f"HEAD request failed for url {url} with status code {response.status_code}."
Expand All @@ -174,7 +174,7 @@ def get_from_cache(url: str, cache_dir: Path = None) -> Path:
logger.info("%s not found in cache, downloading to %s", url, temp_filename)

# GET file object
req = requests.get(url, stream=True)
req = requests.get(url, stream=True, headers={"User-Agent": "Flair"})
content_length = req.headers.get("Content-Length")
total = int(content_length) if content_length is not None else None
progress = Tqdm.tqdm(unit="B", total=total)
Expand Down

0 comments on commit 5b728fd

Please sign in to comment.