Refactor Exact path matthing
This commit is contained in:
parent
703c2d6f8e
commit
cdd6437380
2 changed files with 3 additions and 3 deletions
|
@ -406,7 +406,7 @@ func buildLocation(input interface{}, enforceRegex bool) string {
|
|||
}
|
||||
|
||||
if location.PathType != nil && *location.PathType == networkingv1beta1.PathTypeExact {
|
||||
return fmt.Sprintf(`= %s`, path)
|
||||
return fmt.Sprintf(`~ ^%s$`, path)
|
||||
}
|
||||
|
||||
return path
|
||||
|
|
|
@ -60,7 +60,7 @@ var _ = framework.IngressNginxDescribe("[Ingress] [PathType] exact", func() {
|
|||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
return strings.Contains(server, host) &&
|
||||
strings.Contains(server, "location = /exact") &&
|
||||
strings.Contains(server, "location ~ ^/exact$") &&
|
||||
strings.Contains(server, "location /exact")
|
||||
})
|
||||
|
||||
|
@ -98,7 +98,7 @@ var _ = framework.IngressNginxDescribe("[Ingress] [PathType] exact", func() {
|
|||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
return strings.Contains(server, host) &&
|
||||
strings.Contains(server, "location = /exact") &&
|
||||
strings.Contains(server, "location ~ ^/exact$") &&
|
||||
strings.Contains(server, "location /exact")
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue