diff options
author | Erik Johnston <erik@matrix.org> | 2016-03-23 16:13:05 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-03-23 16:25:54 +0000 |
commit | acdfef7b1443a8260c43e31e9944b74dfdf286dc (patch) | |
tree | cba181b0c3da5e0b53e76e45e71bbba510c09f15 /synapse/http | |
parent | Intern sender, event_id and room_id in events (diff) | |
download | synapse-acdfef7b1443a8260c43e31e9944b74dfdf286dc.tar.xz |
Intern all the things
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/server.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py index b17b190ee5..b82196fd5e 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -18,6 +18,7 @@ from synapse.api.errors import ( cs_exception, SynapseError, CodeMessageException, UnrecognizedRequestError, Codes ) from synapse.util.logcontext import LoggingContext, PreserveLoggingContext +from synapse.util.caches import intern_dict import synapse.metrics import synapse.events @@ -229,11 +230,12 @@ class JsonResource(HttpServer, resource.Resource): else: servlet_classname = "%r" % callback - args = [ - urllib.unquote(u).decode("UTF-8") if u else u for u in m.groups() - ] + kwargs = intern_dict({ + name: urllib.unquote(value).decode("UTF-8") if value else value + for name, value in m.groupdict().items() + }) - callback_return = yield callback(request, *args) + callback_return = yield callback(request, **kwargs) if callback_return is not None: code, response = callback_return self._send_response(request, code, response) |