Skip to content

Commit

Permalink
Routing: Fix regexp syntax support in UserMatcher (#3900)
Browse files Browse the repository at this point in the history
  • Loading branch information
vnxme authored Oct 11, 2024
1 parent af7232d commit 5164a82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/router/condition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5164a82

Please sign in to comment.