From 5164a82185c475f9ef0a04cb6d59f5181d9a4851 Mon Sep 17 00:00:00 2001 From: vnxme <46669194+vnxme@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:37:01 +0300 Subject: [PATCH] Routing: Fix regexp syntax support in UserMatcher (#3900) --- app/router/condition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/router/condition.go b/app/router/condition.go index dc806372..89da1adf 100644 --- a/app/router/condition.go +++ b/app/router/condition.go @@ -202,7 +202,7 @@ func NewUserMatcher(users []string) *UserMatcher { for _, user := range users { if len(user) > 0 { if len(user) > 7 && strings.HasPrefix(user, "regexp:") { - if re, err := regexp.Compile(user[7:]); err != nil { + if re, err := regexp.Compile(user[7:]); err == nil { patternsCopy = append(patternsCopy, re) } // Items of users slice with an invalid regexp syntax are ignored.