From 1fdd76b6830ddb966ddcecdd03698b7afaf4f458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 5 Dec 2025 16:30:05 +0100 Subject: [PATCH] correctly handle paths ending in / MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- services/proxy/pkg/router/router.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 {