Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Do the same for leave
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Jan 4, 2022
1 parent e6be7f0 commit 13f9028
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions federationapi/routing/leave.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,16 @@ func SendLeave(
}
}

if event.StateKey() == nil {
if event.StateKey() == nil || event.StateKeyEquals("") {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: jsonerror.InvalidArgumentValue("missing state_key"),
JSON: jsonerror.BadJSON("No state key was provided in the leave event."),
}
}
if !event.StateKeyEquals(event.Sender()) {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: jsonerror.BadJSON("Event state key must match the event sender."),
}
}

Expand Down

0 comments on commit 13f9028

Please sign in to comment.