summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-10-11 07:50:34 -0400
committerGitHub <noreply@github.com>2023-10-11 07:50:34 -0400
commitd6b7d49a61ca4c6f87d93ff9eb6a9fa6faef443c (patch)
tree0dd8e55176756df134de9bc37adbdd13399f48c3 /synapse
parentInline simple_search_list/simple_search_list_txn. (#16434) (diff)
downloadsynapse-d6b7d49a61ca4c6f87d93ff9eb6a9fa6faef443c.tar.xz
Handle content types with parameters. (#16440)
Diffstat (limited to 'synapse')
-rw-r--r--synapse/media/_base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/media/_base.py b/synapse/media/_base.py

index 13345acf75..860e5ddca2 100644 --- a/synapse/media/_base.py +++ b/synapse/media/_base.py
@@ -148,7 +148,9 @@ def add_file_headers( # A strict subset of content types is allowed to be inlined so that they may # be viewed directly in a browser. Other file types are forced to be downloads. - if media_type.lower() in INLINE_CONTENT_TYPES: + # + # Only the type & subtype are important, parameters can be ignored. + if media_type.lower().split(";", 1)[0] in INLINE_CONTENT_TYPES: disposition = "inline" else: disposition = "attachment"