Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Stop parsing the unspecced type parameter on thumbnail requests. (#15137
Browse files Browse the repository at this point in the history
)

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.
  • Loading branch information
clokep authored Feb 23, 2023
1 parent ec79870 commit f8a584e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/15137.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove the undocumented and unspecced `type` parameter to the `/thumbnail` endpoint.
3 changes: 2 additions & 1 deletion synapse/rest/media/v1/thumbnail_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ async def _async_render_GET(self, request: SynapseRequest) -> None:
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:
Expand Down

0 comments on commit f8a584e

Please sign in to comment.