Skip to content

Commit

Permalink
conformance: Add additional path matching edge cases
Browse files Browse the repository at this point in the history
- trailing slash on path prefix should match
- path prefixes are path segment matches not string prefix matches
- test to ensure a path containing the prefix is not matched

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed Jan 5, 2023
1 parent 46d4088 commit 070a6b6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions conformance/tests/httproute-matching.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ var HTTPRouteMatching = suite.ConformanceTest{
Request: http.Request{Path: "/", Headers: map[string]string{"Version": "two"}},
Backend: "infra-backend-v2",
Namespace: ns,
}, {
Request: http.Request{Path: "/v2/"},
Backend: "infra-backend-v2",
Namespace: ns,
}, {
// Not a path segment prefix so should not match /v2.
Request: http.Request{Path: "/v2example"},
Backend: "infra-backend-v1",
Namespace: ns,
}, {
Request: http.Request{Path: "/foo/v2/example"},
Backend: "infra-backend-v1",
Namespace: ns,
}}

for i := range testCases {
Expand Down

0 comments on commit 070a6b6

Please sign in to comment.