diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-08-25 09:51:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 09:51:36 +0100 |
commit | 16156b0b0988e7b1746b2834e6357c3c90bc8465 (patch) | |
tree | b2813ef5396092d2c30161a692f757531d6e7a1a /federationapi/routing/join.go | |
parent | 522bd2999f605258e95565c6d648d2f7ea001ea4 (diff) |
Fix 500s on `/state`, `/state_ids` when state not known (#2672)
This was due to bad error bubbling.
Diffstat (limited to 'federationapi/routing/join.go')
-rw-r--r-- | federationapi/routing/join.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index b48eaf78..1a121987 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -329,6 +329,12 @@ func SendJoin( JSON: jsonerror.NotFound("Room does not exist"), } } + if !stateAndAuthChainResponse.StateKnown { + return util.JSONResponse{ + Code: http.StatusForbidden, + JSON: jsonerror.Forbidden("State not known"), + } + } // Check if the user is already in the room. If they're already in then // there isn't much point in sending another join event into the room. |