diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-11-18 18:06:35 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-11-18 18:06:35 +0000 |
commit | 572a1ca42ade9d6fa1b50d994735fd3e000b403a (patch) | |
tree | 59e9bb7eadca311bdac91dccf92200933c9be639 /synapse/rest | |
parent | Remember to URL decode the room_id in room initialSync (diff) | |
download | synapse-572a1ca42ade9d6fa1b50d994735fd3e000b403a.tar.xz |
Remember also to UTF-8 decode bytes in room alias names in directory server URLs
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/directory.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/rest/directory.py b/synapse/rest/directory.py index 5aaac05e28..35300c6a6f 100644 --- a/synapse/rest/directory.py +++ b/synapse/rest/directory.py @@ -36,7 +36,9 @@ class ClientDirectoryServer(RestServlet): @defer.inlineCallbacks def on_GET(self, request, room_alias): - room_alias = self.hs.parse_roomalias(urllib.unquote(room_alias)) + room_alias = self.hs.parse_roomalias( + urllib.unquote(room_alias).decode("utf-8") + ) dir_handler = self.handlers.directory_handler res = yield dir_handler.get_association(room_alias) @@ -54,7 +56,9 @@ class ClientDirectoryServer(RestServlet): logger.debug("Got content: %s", content) - room_alias = self.hs.parse_roomalias(urllib.unquote(room_alias)) + room_alias = self.hs.parse_roomalias( + urllib.unquote(room_alias).decode("utf-8") + ) logger.debug("Got room name: %s", room_alias.to_string()) @@ -93,7 +97,9 @@ class ClientDirectoryServer(RestServlet): dir_handler = self.handlers.directory_handler - room_alias = self.hs.parse_roomalias(urllib.unquote(room_alias)) + room_alias = self.hs.parse_roomalias( + urllib.unquote(room_alias).decode("utf-8") + ) yield dir_handler.delete_association( user.to_string(), room_alias |