diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-11-19 17:14:14 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-11-19 17:14:14 +0000 |
commit | 8993affdc06be35b3680501ecd14a8d23901e497 (patch) | |
tree | f8bb1b0556ec1ec18f65213344e3caaa842c5173 /synapse/handlers/directory.py | |
parent | remove demo webserver since synapse serves up the webclient itself (diff) | |
download | synapse-8993affdc06be35b3680501ecd14a8d23901e497.tar.xz |
SYN-153: Raise 404 if room alias is not found
Diffstat (limited to 'synapse/handlers/directory.py')
-rw-r--r-- | synapse/handlers/directory.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py index 98ac0684fc..ed9b0f8551 100644 --- a/synapse/handlers/directory.py +++ b/synapse/handlers/directory.py @@ -122,10 +122,14 @@ class DirectoryHandler(BaseHandler): room_alias ) - defer.returnValue({ - "room_id": result.room_id, - "servers": result.servers, - }) + if result is not None: + defer.returnValue({ + "room_id": result.room_id, + "servers": result.servers, + }) + else: + raise SynapseError(404, "Room alias \"%s\" not found", room_alias) + @defer.inlineCallbacks def send_room_alias_update_event(self, user_id, room_id): |