From 35bc2e98e665c0e676f3a898ed2728df4a1a1df7 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 9 Nov 2021 11:05:44 +0000 Subject: [PATCH] Fix return codes --- clientapi/routing/joinroom.go | 1 - federationapi/routing/join.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/clientapi/routing/joinroom.go b/clientapi/routing/joinroom.go index 74b6a93c..578aaec5 100644 --- a/clientapi/routing/joinroom.go +++ b/clientapi/routing/joinroom.go @@ -81,7 +81,6 @@ func JoinRoomByIDOrAlias( defer close(done) rsAPI.PerformJoin(req.Context(), &joinReq, &joinRes) if joinRes.Error != nil { - joinRes.Error.RemoteCode = http.StatusForbidden done <- joinRes.Error.JSONResponse() } else { done <- util.JSONResponse{ diff --git a/federationapi/routing/join.go b/federationapi/routing/join.go index 1e685940..0f213048 100644 --- a/federationapi/routing/join.go +++ b/federationapi/routing/join.go @@ -322,8 +322,8 @@ func attemptMakeJoinForRestrictedMembership( logger.Error("No room matching join rule memberships found") return util.JSONResponse{ - Code: http.StatusBadRequest, - JSON: jsonerror.UnableToAuthoriseJoin("You are not joined to any allowed rooms"), + Code: http.StatusForbidden, + JSON: jsonerror.Forbidden("You are not joined to any allowed rooms"), } }