mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-25 02:55:46 +03:00
7b67e93d49
Fix https://github.com/matrix-org/synapse/issues/13016 ## New error code and status ### Before Previously, we returned a `404` for `/thumbnail` which isn't even in the spec. ```json { "errcode": "M_NOT_FOUND", "error": "Not found [b'hs1', b'tefQeZhmVxoiBfuFQUKRzJxc']" } ``` ### After What does the spec say? > 400: The request does not make sense to the server, or the server cannot thumbnail the content. For example, the client requested non-integer dimensions or asked for negatively-sized images. > > *-- https://spec.matrix.org/v1.1/client-server-api/#get_matrixmediav3thumbnailservernamemediaid* Now with this PR, we respond with a `400` when we don't have thumbnails to serve and we explain why we might not have any thumbnails. ```json { "errcode": "M_UNKNOWN", "error": "Cannot find any thumbnails for the requested media ([b'example.com', b'12345']). This might mean the media is not a supported_media_format=(image/jpeg, image/jpg, image/webp, image/gif, image/png) or that thumbnailing failed for some other reason. (Dynamic thumbnails are disabled on this server.)", } ``` > Cannot find any thumbnails for the requested media ([b'example.com', b'12345']). This might mean the media is not a supported_media_format=(image/jpeg, image/jpg, image/webp, image/gif, image/png) or that thumbnailing failed for some other reason. (Dynamic thumbnails are disabled on this server.) --- We still respond with a 404 in many other places. But we can iterate on those later and maybe keep some in some specific places after spec updates/clarification: https://github.com/matrix-org/matrix-spec/issues/1122 We can also iterate on the bugs where Synapse doesn't thumbnail when it should in other issues/PRs. |
||
---|---|---|
.. | ||
.gitignore | ||
12943.misc | ||
12967.removal | ||
13038.feature | ||
13094.misc | ||
13175.misc | ||
13192.removal | ||
13198.misc | ||
13208.feature | ||
13215.misc | ||
13218.misc | ||
13220.feature | ||
13224.misc | ||
13231.doc | ||
13233.doc | ||
13239.removal | ||
13240.misc | ||
13242.misc | ||
13251.misc | ||
13253.misc | ||
13254.misc | ||
13255.misc | ||
13257.misc | ||
13260.misc | ||
13261.doc | ||
13263.bugfix | ||
13266.misc | ||
13267.misc | ||
13270.bugfix | ||
13274.misc | ||
13278.bugfix | ||
13279.misc | ||
13284.misc | ||
13285.misc |