Skip to content

Commit

Permalink
Handle PathMatchExact case
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Cattermole <acatterm@redhat.com>
  • Loading branch information
adam-cattermole committed Nov 1, 2024
1 parent 1eda39d commit b37ca3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/wasm/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,12 @@ func predicateFromPathMatch(pathMatch gatewayapiv1.HTTPPathMatch) string {
}

if pathMatch.Type != nil {
if val, ok := PathMatchTypeMap[*pathMatch.Type]; ok {
operator = val
if *pathMatch.Type == gatewayapiv1.PathMatchExact {
return fmt.Sprintf("request.url_path == '%s'", value)
} else {
if val, ok := PathMatchTypeMap[*pathMatch.Type]; ok {
operator = val
}
}
}
return fmt.Sprintf("request.url_path.%s('%s')", operator, value)
Expand Down

0 comments on commit b37ca3f

Please sign in to comment.