From d88db5efbf752dfe3847d93d3f6c8f93e86e40db Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Sat, 24 Dec 2022 00:17:43 -0500 Subject: [PATCH] BunnyCDN doesn't return content-type (#251) --- core/files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/files.py b/core/files.py index 84cb24b..7501cbb 100644 --- a/core/files.py +++ b/core/files.py @@ -63,6 +63,8 @@ async def get_remote_file( pass if allow_download: file = ContentFile(await stream.aread(), name=url) - return file, stream.headers["content-type"] + return file, stream.headers.get( + "content-type", "application/octet-stream" + ) return None, None