diff options
author | Erik Johnston <erik@matrix.org> | 2015-06-30 09:33:48 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-06-30 09:35:44 +0100 |
commit | 2124f668db4a7c19e3ed8357dad887711b3d3c35 (patch) | |
tree | d5d3c18664fb23f60c73accdd2af819af965d102 /synapse/rest/media/v1/download_resource.py | |
parent | Oops: underride rule had an identifier with override in it. (diff) | |
download | synapse-2124f668db4a7c19e3ed8357dad887711b3d3c35.tar.xz |
Add Content-Disposition headers to media repo v1 downloads
Diffstat (limited to 'synapse/rest/media/v1/download_resource.py')
-rw-r--r-- | synapse/rest/media/v1/download_resource.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/download_resource.py b/synapse/rest/media/v1/download_resource.py index 0fe6abf647..2af48ab62f 100644 --- a/synapse/rest/media/v1/download_resource.py +++ b/synapse/rest/media/v1/download_resource.py @@ -47,10 +47,12 @@ class DownloadResource(BaseMediaResource): media_type = media_info["media_type"] media_length = media_info["media_length"] + upload_name = media_info["upload_name"] file_path = self.filepaths.local_media_filepath(media_id) yield self._respond_with_file( - request, media_type, file_path, media_length + request, media_type, file_path, media_length, + upload_name=upload_name, ) @defer.inlineCallbacks @@ -60,11 +62,13 @@ class DownloadResource(BaseMediaResource): media_type = media_info["media_type"] media_length = media_info["media_length"] filesystem_id = media_info["filesystem_id"] + upload_name = media_info["upload_name"] file_path = self.filepaths.remote_media_filepath( server_name, filesystem_id ) yield self._respond_with_file( - request, media_type, file_path, media_length + request, media_type, file_path, media_length, + upload_name=upload_name, ) |