Skip to content

Commit

Permalink
Clarifying HTTPRoute exact match behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
robscott authored and k8s-infra-cherrypick-robot committed May 23, 2023
1 parent dfe12a7 commit 9df33e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apis/v1beta1/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ type HTTPRouteRule struct {
type PathMatchType string

const (
// Matches the URL path exactly and with case sensitivity.
// Matches the URL path exactly and with case sensitivity. This means that
// an exact path match on `/abc` will only match requests to `/abc`, NOT
// `/abc/`, `/Abc`, or `/abcd`.
PathMatchExact PathMatchType = "Exact"

// Matches based on a URL path prefix split by `/`. Matching is
Expand Down
3 changes: 3 additions & 0 deletions conformance/tests/httproute-exact-path-matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ var HTTPExactPathMatching = suite.ConformanceTest{
}, {
Request: http.Request{Path: "/two/"},
Response: http.Response{StatusCode: 404},
}, {
Request: http.Request{Path: "/Two"},
Response: http.Response{StatusCode: 404},
},
}

Expand Down

0 comments on commit 9df33e5

Please sign in to comment.