Skip to content

Commit

Permalink
Merge pull request #279 from SmartAPI/fix-downloader-missing-header
Browse files Browse the repository at this point in the history
Fix downloader missing header.
  • Loading branch information
marcodarko authored Nov 16, 2024
2 parents 32027a1 + 18c5816 commit a6a1e0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ async def download_async(url, timeout=20, raise_error=True):


def download_mapping(url):
response = requests.get(url)
headers = {
'User-Agent': 'SmartAPI'
}
response = requests.get(url, headers=headers, timeout=60)
response.raise_for_status()

return decoder.to_dict(stream=response.content, ext=file_extension(url), ctype=response.headers.get("Content-Type"))
Expand Down

0 comments on commit a6a1e0c

Please sign in to comment.