Validate the request

This commit is contained in:
Till Faelligen 2022-02-11 17:17:38 +01:00
parent baefab89c9
commit bfe6524e36

View file

@ -83,6 +83,14 @@ func SendServerNotice(
return *resErr
}
// check that all required fields are set
if !r.validate() {
return util.JSONResponse{
Code: http.StatusBadRequest,
JSON: jsonerror.BadJSON("Invalid request"),
}
}
// get rooms for specified user
allUserRooms := []string{}
userRooms := api.QueryRoomsForUserResponse{}