summary refs log tree commit diff
path: root/synapse/rest/media
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-02-23 16:07:46 -0500
committerGitHub <noreply@github.com>2023-02-23 16:07:46 -0500
commitf8a584ed0259cbb3c3a51726d1008d04c26b4bd8 (patch)
treebd33166a29b47fb9ae2919377b8aaf05e858d317 /synapse/rest/media
parentFix a typo in MSC3873 config option. (#15138) (diff)
downloadsynapse-f8a584ed0259cbb3c3a51726d1008d04c26b4bd8.tar.xz
Stop parsing the unspecced type parameter on thumbnail requests. (#15137)
Ideally we would replace this with parsing of the Accept header
or something else, but for now just make Synapse spec compliant
by ignoring the unspecced parameter.

It does not seem that this is ever sent by a client, and even if it is
there's a reasonable fallback.
Diffstat (limited to 'synapse/rest/media')
-rw-r--r--synapse/rest/media/v1/thumbnail_resource.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/thumbnail_resource.py b/synapse/rest/media/v1/thumbnail_resource.py
index 5f725c7600..3e720018b3 100644
--- a/synapse/rest/media/v1/thumbnail_resource.py
+++ b/synapse/rest/media/v1/thumbnail_resource.py
@@ -69,7 +69,8 @@ class ThumbnailResource(DirectServeJsonResource):
         width = parse_integer(request, "width", required=True)
         height = parse_integer(request, "height", required=True)
         method = parse_string(request, "method", "scale")
-        m_type = parse_string(request, "type", "image/png")
+        # TODO Parse the Accept header to get an prioritised list of thumbnail types.
+        m_type = "image/png"
 
         if server_name == self.server_name:
             if self.dynamic_thumbnails: