Update HTTP status codes

It looks like the spec calls for these to be 400, rather than 403: https://matrix.org/docs/spec/client_server/r0.6.1#post-matrix-client-r0-rooms-roomid-forget
This commit is contained in:
Neil Alexander 2020-11-05 09:54:39 +00:00 committed by GitHub
parent 7c99beb68a
commit bddd58d2c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -426,13 +426,13 @@ func SendForget(
}
if membershipRes.IsInRoom {
return util.JSONResponse{
Code: http.StatusForbidden,
Code: http.StatusBadRequest,
JSON: jsonerror.Forbidden("user is still a member of the room"),
}
}
if !membershipRes.HasBeenInRoom {
return util.JSONResponse{
Code: http.StatusForbidden,
Code: http.StatusBadRequest,
JSON: jsonerror.Forbidden("user did not belong to room"),
}
}