Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upload: Ensure that we always have a content-type.

Alex Vandiver0c6b3373beaa
diff --git a/zerver/views/upload.py b/zerver/views/upload.py
index cecb6868f94..7b7f4299c5d 100644
--- a/zerver/views/upload.py
+++ b/zerver/views/upload.py
@@ -131,8 +131,7 @@ def serve_local(
return HttpResponseNotFound("<p>File not found</p>")
if content_type is None:
- content_type = guess_type(filename)[0]
- assert content_type is not None
+ content_type = guess_type(filename)[0] or "application/octet-stream"
download = force_download or bare_content_type(content_type) not in INLINE_MIME_TYPES
if settings.DEVELOPMENT: