From 070a6b65bcdc6fbc85f69b4882de2569c9e477b7 Mon Sep 17 00:00:00 2001 From: Sunjay Bhatia Date: Thu, 5 Jan 2023 19:00:12 +0000 Subject: [PATCH] conformance: Add additional path matching edge cases - 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 --- conformance/tests/httproute-matching.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/conformance/tests/httproute-matching.go b/conformance/tests/httproute-matching.go index a0957ab16b..596f04cbf5 100644 --- a/conformance/tests/httproute-matching.go +++ b/conformance/tests/httproute-matching.go @@ -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 {