Skip to content

Commit

Permalink
fix url rewrite
Browse files Browse the repository at this point in the history
Signed-off-by: Arko Dasgupta <[email protected]>
  • Loading branch information
arkodg committed Oct 30, 2023
1 parent a761900 commit 5680ab4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/xds/translator/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ func buildXdsURLRewriteAction(destName string, urlRewrite *ir.URLRewrite, pathMa
(*urlRewrite.Path.PrefixMatchReplace == "" || *urlRewrite.Path.PrefixMatchReplace == "/") {
routeAction.RegexRewrite = &matcherv3.RegexMatchAndSubstitute{
Pattern: &matcherv3.RegexMatcher{
Regex: "^" + *pathMatch.Prefix,
Regex: "^" + *pathMatch.Prefix + `\/*`,
},
Substitution: "",
Substitution: "/",
}
} else {
routeAction.PrefixRewrite = *urlRewrite.Path.PrefixMatchReplace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
cluster: rewrite-route-dest
regexRewrite:
pattern:
regex: ^/origin/
regex: ^/origin/\/*
substitution: /

0 comments on commit 5680ab4

Please sign in to comment.