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

Commit

Permalink
Merge pull request #3080 from matrix-org/rav/fix_500_on_rejoin
Browse files Browse the repository at this point in the history
Return a 404 rather than a 500 on rejoining empty rooms
  • Loading branch information
richvdh authored Apr 9, 2018
2 parents 13decdb + f3ef606 commit d2c6f4d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions synapse/handlers/room_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,14 @@ def __init__(self, hs):
def _remote_join(self, requester, remote_room_hosts, room_id, user, content):
"""Implements RoomMemberHandler._remote_join
"""
# filter ourselves out of remote_room_hosts: do_invite_join ignores it
# and if it is the only entry we'd like to return a 404 rather than a
# 500.

remote_room_hosts = [
host for host in remote_room_hosts if host != self.hs.hostname
]

if len(remote_room_hosts) == 0:
raise SynapseError(404, "No known servers")

Expand Down

0 comments on commit d2c6f4d

Please sign in to comment.