-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 404
as valid response for /thumbnail
and /download
when mediaId
does not exist
#1122
Labels
Comments
Related: #1095 |
turt2live
added
A-Client-Server
Issues affecting the CS API
improvement
An idea/future MSC for the spec
labels
Jun 13, 2022
4 tasks
MadLittleMods
added a commit
to matrix-org/synapse
that referenced
this issue
Jul 15, 2022
Fix #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: matrix-org/matrix-spec#1122 We can also iterate on the bugs where Synapse doesn't thumbnail when it should in other issues/PRs.
turt2live
changed the title
Add
Add Nov 24, 2023
404
as valid response for /thumbnail
when mediaId
does not exist404
as valid response for /thumbnail
and /download
when mediaId
does not exist
see also: #1678 |
turt2live
added
spec-omission
implemented but not currently specified
and removed
improvement
An idea/future MSC for the spec
labels
Nov 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
400
makes a lot of sense for all of the scenarios where the media repository can't provide a thumbnail for whatever reason when the media exists.But
404
probably makes more sense whenmediaId
isn't valid and doesn't exist.Current spec
https://spec.matrix.org/v1.1/client-server-api/#get_matrixmediav3thumbnailservernamemediaid
Responses
The text was updated successfully, but these errors were encountered: