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.
pull/15152/head
Patrick Cloke 2023-02-23 16:07:46 -05:00 committed by GitHub
parent ec79870f14
commit f8a584ed02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1 @@
Remove the undocumented and unspecced `type` parameter to the `/thumbnail` endpoint.

View File

@ -69,7 +69,8 @@ class ThumbnailResource(DirectServeJsonResource):
width = parse_integer(request, "width", required=True) width = parse_integer(request, "width", required=True)
height = parse_integer(request, "height", required=True) height = parse_integer(request, "height", required=True)
method = parse_string(request, "method", "scale") 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 server_name == self.server_name:
if self.dynamic_thumbnails: if self.dynamic_thumbnails: