summary refs log tree commit diff
path: root/synapse/rest/media/v1/upload_resource.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-06-30 09:33:48 +0100
committerErik Johnston <erik@matrix.org>2015-06-30 09:35:44 +0100
commit2124f668db4a7c19e3ed8357dad887711b3d3c35 (patch)
treed5d3c18664fb23f60c73accdd2af819af965d102 /synapse/rest/media/v1/upload_resource.py
parentOops: underride rule had an identifier with override in it. (diff)
downloadsynapse-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.py6
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
         )