Skip to content

Commit

Permalink
Bug fix for downloading files via the API
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Nov 14, 2022
1 parent d5cdeec commit c886fa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inventree/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def downloadFile(self, url, destination, overwrite=False, params=None):

headers = response.headers

if 'text/html' in headers['Content-Type']:
if 'Content-Type' in headers and 'text/html' in headers['Content-Type']:
logger.error(f"Error downloading file '{url}': Server return invalid response (text/html)")
return False

Expand Down

0 comments on commit c886fa6

Please sign in to comment.