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/upload_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/upload_resource.py')
-rw-r--r-- | synapse/rest/media/v1/upload_resource.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/upload_resource.py b/synapse/rest/media/v1/upload_resource.py index cc571976a5..92e855a448 100644 --- a/synapse/rest/media/v1/upload_resource.py +++ b/synapse/rest/media/v1/upload_resource.py @@ -84,6 +84,10 @@ class UploadResource(BaseMediaResource): code=413, ) + upload_name = request.args.get("filename", None) + if upload_name: + upload_name = upload_name[0] + headers = request.requestHeaders if headers.hasHeader("Content-Type"): @@ -99,7 +103,7 @@ class UploadResource(BaseMediaResource): # TODO(markjh): parse content-dispostion content_uri = yield self.create_content( - media_type, None, request.content.read(), + media_type, upload_name, request.content.read(), content_length, auth_user ) |