summary refs log tree commit diff
path: root/synapse/rest/media/v1/upload_resource.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-08-26 16:26:37 +0100
committerMark Haines <mark.haines@matrix.org>2015-08-26 16:26:37 +0100
commite85c7873dc885c18705c2a77d8487517379d64fb (patch)
treec59c6030dc0347abea4963f2f11f7175e63ffe46 /synapse/rest/media/v1/upload_resource.py
parentMerge pull request #252 from matrix-org/erikj/typing_loop (diff)
downloadsynapse-e85c7873dc885c18705c2a77d8487517379d64fb.tar.xz
Allow non-ascii filenames for attachments
Diffstat (limited to 'synapse/rest/media/v1/upload_resource.py')
-rw-r--r--synapse/rest/media/v1/upload_resource.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/synapse/rest/media/v1/upload_resource.py b/synapse/rest/media/v1/upload_resource.py
index cdd1d44e07..21d8fb9ce9 100644
--- a/synapse/rest/media/v1/upload_resource.py
+++ b/synapse/rest/media/v1/upload_resource.py
@@ -15,7 +15,7 @@
 
 from synapse.http.server import respond_with_json, request_handler
 
-from synapse.util.stringutils import random_string, is_ascii
+from synapse.util.stringutils import random_string
 from synapse.api.errors import SynapseError
 
 from twisted.web.server import NOT_DONE_YET
@@ -86,9 +86,7 @@ class UploadResource(BaseMediaResource):
 
         upload_name = request.args.get("filename", None)
         if upload_name:
-            upload_name = upload_name[0]
-            if upload_name and not is_ascii(upload_name):
-                raise SynapseError(400, "filename must be ascii")
+            upload_name = upload_name[0].decode('UTF-8')
 
         headers = request.requestHeaders