fix(matrix): add filesize to nio.upload() for Synapse compatibility

Cherry-picked from PR #4343 by pjay-io.
Synapse rejects chunked uploads without Content-Length. Adding
filesize=len(data) ensures the upload includes proper sizing.
This commit is contained in:
pjay-io
2026-04-05 10:44:13 -07:00
committed by Teknium
parent 914f7461dc
commit 9d7c288d86

View File

@@ -604,6 +604,7 @@ class MatrixAdapter(BasePlatformAdapter):
io.BytesIO(data),
content_type=content_type,
filename=filename,
filesize=len(data),
)
if not isinstance(resp, nio.UploadResponse):
err = getattr(resp, "message", str(resp))