Skip to content

Commit

Permalink
fix path match
Browse files Browse the repository at this point in the history
Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg committed Oct 30, 2023
1 parent 7ddf119 commit d6ad5f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/xds/translator/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -104,6 +106,8 @@ func buildXdsRouteMatch(pathMatch *ir.StringMatch, headerMatches []*ir.StringMat
Prefix: "/",
}
} else {
// Remove trailing /
strings.TrimSuffix(*pathMatch.Prefix, "/")

Check failure on line 110 in internal/xds/translator/route.go

View workflow job for this annotation

GitHub Actions / lint

SA4017: TrimSuffix doesn't have side effects and its return value is ignored (staticcheck)
outMatch.PathSpecifier = &routev3.RouteMatch_PathSeparatedPrefix{
PathSeparatedPrefix: *pathMatch.Prefix,
}
Expand Down

0 comments on commit d6ad5f3

Please sign in to comment.