From 64f6ad32f0d0b0119b683abb1cc3b16aa6d28319 Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Fri, 23 Jun 2023 16:17:46 -0400 Subject: [PATCH 1/2] Add note about path prefix matching behavior for HTTPRoute config --- .../connect/gateways/api-gateway/configuration/http-route.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx b/website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx index 997e2bbf692e..c135f39679c1 100644 --- a/website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx +++ b/website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx @@ -533,6 +533,10 @@ Specifies the HTTP method to match. Specifies type of match for the path: `"exact"`, `"prefix"`, or `"regex"`. +-> **Note:** Prefix matching uses simple string matching when comparing to the path. This differs slightly from the +[Kubernetes Gateway API specification](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io%2fv1beta1.PathMatchType) +which declares that path prefix matching is done on a path element by element basis. + #### Values - Default: none From 7cd1e75cb849403a74f2718e8c0185b8eef3d5db Mon Sep 17 00:00:00 2001 From: Nathan Coleman Date: Fri, 23 Jun 2023 17:18:03 -0400 Subject: [PATCH 2/2] Update website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> --- .../gateways/api-gateway/configuration/http-route.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx b/website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx index c135f39679c1..02d2725ad698 100644 --- a/website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx +++ b/website/content/docs/connect/gateways/api-gateway/configuration/http-route.mdx @@ -533,9 +533,10 @@ Specifies the HTTP method to match. Specifies type of match for the path: `"exact"`, `"prefix"`, or `"regex"`. --> **Note:** Prefix matching uses simple string matching when comparing to the path. This differs slightly from the -[Kubernetes Gateway API specification](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io%2fv1beta1.PathMatchType) -which declares that path prefix matching is done on a path element by element basis. +If set to `prefix`, Consul uses simple string matching to identify incoming request prefixes. For example, if the route is configured to match incoming requests to services prefixed with `/dev`, then the gateway would match requests to `/dev-` and `/deviate` and route to the upstream. + +This deviates from the +[Kubernetes Gateway API specification](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io%2fv1beta1.PathMatchType), which matches on full path elements. In the previous example, _only_ requests to `/dev` or `/dev/` would match. #### Values