Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

return 404 if room not found #3620

Merged
merged 2 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ Christoph Witzany <christoph at web.crofting.com>
* Add LDAP support for authentication

Pierre Jaury <pierre at jaury.eu>
* Docker packaging
* Docker packaging

Serban Constantin <serban.constantin at gmail dot com>
* Small bug fix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That file is in general for people who contributed a feature. I would say, that your "Small bug fix" does not count.
If it would it should contain all contributors.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the CONTRIBUTING.rst file says, anyone making a PR is welcome to add themselves, for any contribution. It's not the size that that matters...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. Then nvm

1 change: 1 addition & 0 deletions changelog.d/2952.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make /directory/list API return 404 for room not found instead of 400
4 changes: 2 additions & 2 deletions synapse/rest/client/v1/directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from twisted.internet import defer

from synapse.api.errors import AuthError, Codes, SynapseError
from synapse.api.errors import AuthError, Codes, NotFoundError, SynapseError
from synapse.http.servlet import parse_json_object_from_request
from synapse.types import RoomAlias

Expand Down Expand Up @@ -159,7 +159,7 @@ def __init__(self, hs):
def on_GET(self, request, room_id):
room = yield self.store.get_room(room_id)
if room is None:
raise SynapseError(400, "Unknown room")
raise NotFoundError("Unknown room")

defer.returnValue((200, {
"visibility": "public" if room["is_public"] else "private"
Expand Down