diff --git a/services/proxy/pkg/router/router.go b/services/proxy/pkg/router/router.go index cdf93b7790..9406ef0af2 100644 --- a/services/proxy/pkg/router/router.go +++ b/services/proxy/pkg/router/router.go @@ -272,7 +272,11 @@ func (rt Router) regexRouteMatcher(pattern string, target url.URL) bool { } func prefixRouteMatcher(prefix string, target url.URL) bool { - return strings.HasPrefix(path.Clean(target.Path), prefix) && prefix != "/" + cleanTarget := path.Clean(target.Path) + if strings.HasSuffix(target.Path, "/") { + cleanTarget += "/" + } + return strings.HasPrefix(cleanTarget, prefix) && prefix != "/" } func singleJoiningSlash(a, b string) string {