From 32c130ed933a8e420dcdf394913b7d2152632e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 26 Aug 2016 17:57:52 +0200 Subject: [PATCH] Fall back to application/octet-stream when there is no content-type header --- pillar/api/file_storage/moving.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillar/api/file_storage/moving.py b/pillar/api/file_storage/moving.py index ce611c0e..5a72f368 100644 --- a/pillar/api/file_storage/moving.py +++ b/pillar/api/file_storage/moving.py @@ -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