Make federation state request 404 when event not in the room - fixes #625 (#716)

Signed-off-by: Alex Chen <minecnly@gmail.com>
main
Alex Chen 2019-06-25 18:32:15 +08:00 committed by Andrew Morgan
parent eaf38ae87e
commit b88112b05d
1 changed files with 4 additions and 0 deletions

View File

@ -103,6 +103,10 @@ func getState(
return nil, resErr
}
if event.RoomID() != roomID {
return nil, &util.JSONResponse{Code: http.StatusNotFound, JSON: nil}
}
prevEventIDs := getIDsFromEventRef(event.PrevEvents())
authEventIDs := getIDsFromEventRef(event.AuthEvents())