From f12ffb660d9e9aacd35f7e95aed3aa651ecffbdc Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Tue, 13 Mar 2018 08:35:56 -0700 Subject: [PATCH] Correct if statement logic (#415) Should return error if we didn't find an Application Service, not the other way around. Reported by @APWhitehat Signed-off-by: Andrew Morgan (https://amorgan.xyz) --- .../matrix-org/dendrite/clientapi/routing/register.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go index 77e875ec1..3d6add044 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/register.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/register.go @@ -309,7 +309,7 @@ func validateApplicationService( break } } - if matchedApplicationService != nil { + if matchedApplicationService == nil { return "", &util.JSONResponse{ Code: 401, JSON: jsonerror.UnknownToken("Supplied access_token does not match any known application service"),