SYN-154: Better error messages when joining an unknown room by ID.

The simple fix doesn't work here because room creation also involves
unknown room IDs. The check relies on the presence of m.room.create for
rooms being created, whereas bogus room IDs have no state events at all.
This commit is contained in:
Kegan Dougal 2015-01-07 15:16:31 +00:00
parent 9b8e348b15
commit 9cb4f75d53
3 changed files with 17 additions and 6 deletions

View file

@ -617,8 +617,8 @@ class FederationHandler(BaseHandler):
@defer.inlineCallbacks
@log_function
def on_backfill_request(self, origin, context, pdu_list, limit):
in_room = yield self.auth.check_host_in_room(context, origin)
def on_backfill_request(self, origin, room_id, pdu_list, limit):
in_room = yield self.auth.check_host_in_room(room_id, origin)
if not in_room:
raise AuthError(403, "Host not in room.")