From d6ad5f3e0adb13e29089a7ca0721bea4dc21cc94 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Sun, 29 Oct 2023 18:01:15 -0700 Subject: [PATCH] fix path match Signed-off-by: Arko Dasgupta --- internal/xds/translator/route.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/xds/translator/route.go b/internal/xds/translator/route.go index 913cbaea926b..0a17b6cc7c56 100644 --- a/internal/xds/translator/route.go +++ b/internal/xds/translator/route.go @@ -6,6 +6,8 @@ package translator import ( + "strings" + corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" routev3 "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" matcherv3 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" @@ -104,6 +106,8 @@ func buildXdsRouteMatch(pathMatch *ir.StringMatch, headerMatches []*ir.StringMat Prefix: "/", } } else { + // Remove trailing / + strings.TrimSuffix(*pathMatch.Prefix, "/") outMatch.PathSpecifier = &routev3.RouteMatch_PathSeparatedPrefix{ PathSeparatedPrefix: *pathMatch.Prefix, }