-
Notifications
You must be signed in to change notification settings - Fork 190
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
/_matrix/federation/v1/media/thumbnail/ responds with wrong Content-Length #17518
Comments
When you say client, what are you referring to? Are you seeing this between synapse <-> synapse or synapse <-> another homeserver implementation?
Just to clarify, when you say a complete and correct response, you mean the response contains the json object + field, ie:
plus the second field which is the thumbnail bytes, and both of these fields add up to 1189 bytes? |
Another federating homeserver, in this case grapevine, where I'm trying to implement Authenticated Media support. Synapse would likely have the same problem as a client, but it doesn't request
That's correct. |
Thanks for reporting this - I think what happened is that the content-length was being calculated based off of the length of the original media file, rather than the thumbnail media file. Hopefully this is fixed in #17532, and since Synapse doesn't make requests to this endpoint (which, as you correctly noted, is why this was missed so far) I added a complement test to ensure the basic functionality of the endpoint. |
Description
When requesting a thumbnail via the new Authenticated Media federation endpoint
/_matrix/federation/v1/media/thumbnail/{mediaId}
, synapse v1.111.0 sends aContent-Length
header that's larger than the actual response body. This makes the request fail on the client with e.g. "unexpected EOF"/"connection reset".Steps to reproduce
Redacted
curl
command line:The response in
/tmp/response
is a complete and correct response containing two parts, the second of which is the correct thumbnail. It is1189
bytes in size in total.As can be seen, the
Content-Length
header is set to3961
, which is way longer than the actual response.The log (see below) also shows the correct length of
1189
.Homeserver
xiretza.xyz
Synapse Version
v1.111.0
Installation Method
Other (please mention below)
Database
postgresql
Workers
Single process
Platform
Arch Linux, x86_64
Configuration
Nothing special
Relevant log output
Anything else that would be useful to know?
No response
The text was updated successfully, but these errors were encountered: