-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Handle missing Content-Type
for remote media
#11044
Comments
There's also the option of:
(Though we'll still need to do one of the above proposals, in the spirit of Postel's Law) |
This is what matrix-org/matrix-spec-proposals#2701 says should be done |
Conclusion from triage:
|
Which endpoint are we talking about here? Presumably |
Yes, |
Our synapse/synapse/rest/media/v1/upload_resource.py Lines 78 to 83 in 0f9adc9
|
Synapse expects other homeservers to always provide the
Content-Type
header when serving media. However, this header is not required by the spec (https://matrix.org/docs/spec/client_server/r0.6.1#id67) and Synapse raises an error when fetching media without aContent-Type
header.As a solution, we could either:
application/octet-stream
when fetching media without aContent-Type
header. We do this for URL previews somewhere.NULL
content type in the database. No schema changes are required. Some mypy-guided code fixes are needed to ensure we handle theseNULL
s correctly.Note that regardless of the solution chosen, Synapse will not generate or serve thumbnails for any remote media without a
Content-Type
header by default, even if the remote homeserver does have thumbnails.https://sentry.matrix.org/sentry/synapse-matrixorg/issues/200963/
The text was updated successfully, but these errors were encountered: