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

Commit f8a584e

Browse files
authored
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.
1 parent ec79870 commit f8a584e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog.d/15137.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove the undocumented and unspecced `type` parameter to the `/thumbnail` endpoint.

synapse/rest/media/v1/thumbnail_resource.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ async def _async_render_GET(self, request: SynapseRequest) -> None:
6969
width = parse_integer(request, "width", required=True)
7070
height = parse_integer(request, "height", required=True)
7171
method = parse_string(request, "method", "scale")
72-
m_type = parse_string(request, "type", "image/png")
72+
# TODO Parse the Accept header to get an prioritised list of thumbnail types.
73+
m_type = "image/png"
7374

7475
if server_name == self.server_name:
7576
if self.dynamic_thumbnails:

0 commit comments

Comments
 (0)