Allow non-ascii filenames for attachments

This commit is contained in:
Mark Haines 2015-08-26 16:26:37 +01:00
parent efdaa5dd55
commit e85c7873dc
3 changed files with 17 additions and 8 deletions

View file

@ -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