We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
rewriteTargetWithoutCaptureGroup
1 parent 9b6dcad commit 979ec08Copy full SHA for 979ec08
cmd/plugin/lints/ingress.go
@@ -18,6 +18,7 @@ package lints
18
19
import (
20
"fmt"
21
+ "regexp"
22
"strings"
23
24
networking "k8s.io/api/networking/v1"
@@ -126,7 +127,7 @@ func annotationPrefixIsNginxOrg(ing *networking.Ingress) bool {
126
127
128
func rewriteTargetWithoutCaptureGroup(ing *networking.Ingress) bool {
129
for name, val := range ing.Annotations {
- if strings.HasSuffix(name, "/rewrite-target") && !strings.Contains(val, "$1") {
130
+ if strings.HasSuffix(name, "/rewrite-target") && !regexp.MustCompile(`\$\d+`).MatchString(val) {
131
return true
132
}
133
0 commit comments