summary refs log tree commit diff
path: root/synapse/rest/media/v1
diff options
context:
space:
mode:
authorrkfg <rkfg@rkfg.me>2021-04-14 18:30:59 +0300
committerGitHub <noreply@github.com>2021-04-14 16:30:59 +0100
commitc9a2b5d4022feab97fa1bce1d67360d09a6e3dcc (patch)
tree04256447b521e44e3981f1bd68080c37677d3530 /synapse/rest/media/v1
parentRemove redundant "coding: utf-8" lines (#9786) (diff)
downloadsynapse-c9a2b5d4022feab97fa1bce1d67360d09a6e3dcc.tar.xz
More robust handling of the Content-Type header for thumbnail generation (#9788)
Signed-off-by: Sergey Shpikin <rkfg@rkfg.me>
Diffstat (limited to 'synapse/rest/media/v1')
-rw-r--r--synapse/rest/media/v1/media_repository.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/media_repository.py b/synapse/rest/media/v1/media_repository.py
index 87e3645ddc..e8a875b900 100644
--- a/synapse/rest/media/v1/media_repository.py
+++ b/synapse/rest/media/v1/media_repository.py
@@ -467,6 +467,9 @@ class MediaRepository:
         return media_info
 
     def _get_thumbnail_requirements(self, media_type):
+        scpos = media_type.find(";")
+        if scpos > 0:
+            media_type = media_type[:scpos]
         return self.thumbnail_requirements.get(media_type, ())
 
     def _generate_thumbnail(