Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarifying HTTPRoute exact match behavior #2055

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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