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

Signed-off-by: Alex Chen <minecnly@gmail.com>
This commit is contained in:
Cnly 2019-05-30 21:58:29 +08:00
parent adaec7c8e7
commit 4030cd2900

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())