diff options
author | Anant Prakash <anantprakashjsr@gmail.com> | 2017-04-14 23:42:42 +0530 |
---|---|---|
committer | Anant Prakash <anantprakashjsr@gmail.com> | 2017-04-14 23:50:59 +0530 |
commit | 574d573ac2c7f345faf61ef549c9d2c39664b3a3 (patch) | |
tree | 309d35665418cab1845da92e7970eb30ad0c7958 /synapse | |
parent | Merge pull request #2115 from matrix-org/erikj/dedupe_federation_repl (diff) | |
download | synapse-574d573ac2c7f345faf61ef549c9d2c39664b3a3.tar.xz |
Check that requested room_id exists
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/rest/client/v1/directory.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/directory.py b/synapse/rest/client/v1/directory.py index 8930f1826f..f15aa5c13f 100644 --- a/synapse/rest/client/v1/directory.py +++ b/synapse/rest/client/v1/directory.py @@ -39,6 +39,7 @@ class ClientDirectoryServer(ClientV1RestServlet): def __init__(self, hs): super(ClientDirectoryServer, self).__init__(hs) + self.store = hs.get_datastore() self.handlers = hs.get_handlers() @defer.inlineCallbacks @@ -70,7 +71,10 @@ class ClientDirectoryServer(ClientV1RestServlet): logger.debug("Got servers: %s", servers) # TODO(erikj): Check types. - # TODO(erikj): Check that room exists + + room = yield self.store.get_room(room_id) + if room is None: + raise SynapseError(400, "Room does not exist") dir_handler = self.handlers.directory_handler |