Fall back to application/octet-stream when there is no content-type header

This commit is contained in:
Sybren A. Stüvel 2016-08-26 17:57:52 +02:00
parent 634b233685
commit 32c130ed93

View File

@ -126,7 +126,7 @@ def fetch_file_from_link(link):
file_dict = {
'file_size': os.fstat(local_file.fileno()).st_size,
'content_type': r.headers['content-type'],
'content_type': r.headers.get('content-type', 'application/octet-stream'),
'local_file': local_file
}
return file_dict