mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Don't answer expensive federation requests for rooms we no longer belong to (#2398)
This includes `/state`, `/state_ids`, `/get_missing_events` and `/backfill`. This should fix #2396.
This commit is contained in:
parent
2ff75b7c80
commit
6deb10f3f6
5 changed files with 51 additions and 0 deletions
|
@ -30,6 +30,12 @@ func GetEventAuth(
|
|||
roomID string,
|
||||
eventID string,
|
||||
) util.JSONResponse {
|
||||
// If we don't think we belong to this room then don't waste the effort
|
||||
// responding to expensive requests for it.
|
||||
if err := ErrorIfLocalServerNotInRoom(ctx, rsAPI, roomID); err != nil {
|
||||
return *err
|
||||
}
|
||||
|
||||
event, resErr := fetchEvent(ctx, rsAPI, eventID)
|
||||
if resErr != nil {
|
||||
return *resErr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue