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
|
@ -45,6 +45,12 @@ func GetMissingEvents(
|
|||
}
|
||||
}
|
||||
|
||||
// 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(httpReq.Context(), rsAPI, roomID); err != nil {
|
||||
return *err
|
||||
}
|
||||
|
||||
var eventsResponse api.QueryMissingEventsResponse
|
||||
if err := rsAPI.QueryMissingEvents(
|
||||
httpReq.Context(), &api.QueryMissingEventsRequest{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue