From bddd58d2c2660917a570690b7f839671eeb755c7 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Thu, 5 Nov 2020 09:54:39 +0000 Subject: [PATCH] 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 --- clientapi/routing/membership.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go index a20cedf2f..e471e2128 100644 --- a/clientapi/routing/membership.go +++ b/clientapi/routing/membership.go @@ -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"), } }