summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-12 15:05:37 +0000
committerErik Johnston <erik@matrix.org>2014-12-12 15:05:37 +0000
commit7b43a503f31e47b0eae9fe2b12fbea5e7fd280f5 (patch)
treecd4846d41b43bc9e5964693fa072b2860507c9ae /synapse/http
parentStore json as UTF-8 and not bytes (diff)
downloadsynapse-7b43a503f31e47b0eae9fe2b12fbea5e7fd280f5.tar.xz
Consistently url decode and decode as utf 8 the URL parts
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/server.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 02277c4998..2d5d71c8aa 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -29,6 +29,7 @@ from twisted.web.util import redirectTo
 
 import collections
 import logging
+import urllib
 
 logger = logging.getLogger(__name__)
 
@@ -122,9 +123,18 @@ class JsonResource(HttpServer, resource.Resource):
                     # We found a match! Trigger callback and then return the
                     # returned response. We pass both the request and any
                     # matched groups from the regex to the callback.
+
+                    logger.debug("url things: %r", m.groups())
+
+                    args = [
+                        urllib.unquote(u).decode("UTF-8") for u in m.groups()
+                    ]
+
+                    logger.debug("url things args: %r", args)
+
                     code, response = yield path_entry.callback(
                         request,
-                        *m.groups()
+                        *args
                     )
 
                     self._send_response(request, code, response)