From 3c250a4f91ec446fa7bd5b39d8e186e6b9cfaa91 Mon Sep 17 00:00:00 2001 From: "Andrew Morgan (https://amorgan.xyz)" Date: Wed, 7 Mar 2018 00:59:31 -0800 Subject: [PATCH] Correct if statement logic 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"),