mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-23 17:49:26 -05: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. |
||
---|---|---|
.. | ||
__init__.py | ||
__main__.py | ||
_base.py | ||
_base.pyi | ||
_util.py | ||
account_validity.py | ||
api.py | ||
appservice.py | ||
auth.py | ||
background_updates.py | ||
cache.py | ||
captcha.py | ||
cas.py | ||
consent.py | ||
database.py | ||
emailconfig.py | ||
experimental.py | ||
federation.py | ||
groups.py | ||
homeserver.py | ||
jwt.py | ||
key.py | ||
logger.py | ||
metrics.py | ||
modules.py | ||
oembed.py | ||
oidc.py | ||
password_auth_providers.py | ||
push.py | ||
ratelimiting.py | ||
redis.py | ||
registration.py | ||
repository.py | ||
retention.py | ||
room_directory.py | ||
room.py | ||
saml2.py | ||
server_notices.py | ||
server.py | ||
spam_checker.py | ||
sso.py | ||
stats.py | ||
third_party_event_rules.py | ||
tls.py | ||
tracer.py | ||
user_directory.py | ||
voip.py | ||
workers.py |