From dadc00caf181fb620e424a770e788ac2c35e2d96 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 9 Nov 2021 14:15:49 +0000 Subject: [PATCH] Return 403s on client API --- clientapi/routing/joinroom.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clientapi/routing/joinroom.go b/clientapi/routing/joinroom.go index 578aaec56..64ba59137 100644 --- a/clientapi/routing/joinroom.go +++ b/clientapi/routing/joinroom.go @@ -102,6 +102,10 @@ func JoinRoomByIDOrAlias( JSON: jsonerror.Unknown("The room join will continue in the background."), } case result := <-done: + if !result.Is2xx() { + // The only error code in the spec for CS /join is 403. + result.Code = http.StatusForbidden + } return result } }