diff options
Diffstat (limited to 'synapse/media')
-rw-r--r-- | synapse/media/v1/media_repository.py | 10 | ||||
-rw-r--r-- | synapse/media/v1/upload_resource.py | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/synapse/media/v1/media_repository.py b/synapse/media/v1/media_repository.py index a0dc56be4b..cbc49aa325 100644 --- a/synapse/media/v1/media_repository.py +++ b/synapse/media/v1/media_repository.py @@ -26,7 +26,7 @@ logger = logging.getLogger(__name__) class MediaRepositoryResource(Resource): - """Profiles file uploading and downloading. + """File uploading and downloading. Uploads are POSTed to a resource which returns a token which is used to GET the download:: @@ -39,9 +39,9 @@ class MediaRepositoryResource(Resource): <= HTTP/1.1 200 OK Content-Type: application/json - { "token": <media-id> } + { "content-uri": "mxc://<server-name>/<media-id>" } - => GET /_matrix/media/v1/download/<media-id> HTTP/1.1 + => GET /_matrix/media/v1/download/<server-name>/<media-id> HTTP/1.1 <= HTTP/1.1 200 OK Content-Type: <media-type> @@ -52,8 +52,8 @@ class MediaRepositoryResource(Resource): Clients can get thumbnails by supplying a desired width and height and thumbnailing method:: - => GET /_matrix/media/v1 - /thumbnail/<media-id>?width=<w>&height=<h>&method=<m> HTTP/1.1 + => GET /_matrix/media/v1/thumbnail/<server_name> + /<media-id>?width=<w>&height=<h>&method=<m> HTTP/1.1 <= HTTP/1.1 200 OK Content-Type: image/jpeg or image/png diff --git a/synapse/media/v1/upload_resource.py b/synapse/media/v1/upload_resource.py index b2449ff03d..5645b0df46 100644 --- a/synapse/media/v1/upload_resource.py +++ b/synapse/media/v1/upload_resource.py @@ -95,8 +95,10 @@ class UploadResource(BaseMediaResource): yield self._generate_local_thumbnails(media_id, media_info) + content_uri = "mxc://%s/%s" % (self.server_name, media_id) + respond_with_json( - request, 200, {"content_token": media_id}, send_cors=True + request, 200, {"content_uri": content_uri}, send_cors=True ) except CodeMessageException as e: logger.exception(e) |