diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-10-11 07:50:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 07:50:34 -0400 |
commit | d6b7d49a61ca4c6f87d93ff9eb6a9fa6faef443c (patch) | |
tree | 0dd8e55176756df134de9bc37adbdd13399f48c3 /synapse/media/_base.py | |
parent | Inline simple_search_list/simple_search_list_txn. (#16434) (diff) | |
download | synapse-d6b7d49a61ca4c6f87d93ff9eb6a9fa6faef443c.tar.xz |
Handle content types with parameters. (#16440)
Diffstat (limited to 'synapse/media/_base.py')
-rw-r--r-- | synapse/media/_base.py | 4 |
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" |