Explorar o código

Routing: Fix regexp syntax support in UserMatcher (#3900)

vnxme hai 1 ano
pai
achega
5164a82185
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/router/condition.go

+ 1 - 1
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.