mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 12:33:40 +00:00
upload: Ensure that we always have a content-type.
Old uploads are stored without a content-type, and guess_type may not provide a type for them.
This commit is contained in:
committed by
Tim Abbott
parent
1bc7696c24
commit
0c6b3373be
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user