From 59bb52462702d7b855a3665bd2304d048e8ba6c2 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Wed, 6 Jul 2022 13:22:09 +0100 Subject: [PATCH] Convert MXCUri to string before JSON encoding --- synapse/rest/media/v1/upload_resource.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synapse/rest/media/v1/upload_resource.py b/synapse/rest/media/v1/upload_resource.py index e73e431dc9f1..05966bf8b104 100644 --- a/synapse/rest/media/v1/upload_resource.py +++ b/synapse/rest/media/v1/upload_resource.py @@ -103,4 +103,6 @@ async def _async_render_POST(self, request: SynapseRequest) -> None: logger.info("Uploaded content with URI %r", content_uri) - respond_with_json(request, 200, {"content_uri": content_uri}, send_cors=True) + respond_with_json( + request, 200, {"content_uri": content_uri.to_string()}, send_cors=True + )