From 7d5ffd04250cae9826b5c9a861b2e3b4aa4ed034 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Fri, 29 Mar 2019 17:12:53 +0000 Subject: [PATCH] router: support prefix wildcards in virtual hosts domains (#6303) Adds prefix wildcard support (foo.*) in virtual host domains Risk Level: Low (does not change current behavior) Testing: Unit tests Docs Changes: updated domains field documentation in proto file Release Notes: updated Fixes #1269 Signed-off-by: Bartosz Borkowski Mirrored from https://github.com/envoyproxy/envoy @ af7c845fc5e37ce5b271e1a7b4566f2d1e8ec290 --- envoy/api/v2/route/route.proto | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/envoy/api/v2/route/route.proto b/envoy/api/v2/route/route.proto index 0c84cfbc..af984991 100644 --- a/envoy/api/v2/route/route.proto +++ b/envoy/api/v2/route/route.proto @@ -39,17 +39,21 @@ message VirtualHost { string name = 1 [(validate.rules).string.min_bytes = 1]; // A list of domains (host/authority header) that will be matched to this - // virtual host. Wildcard hosts are supported in the form of ``*.foo.com`` or - // ``*-bar.foo.com``. + // virtual host. Wildcard hosts are supported in the suffix or prefix form. + // + // Domain search order: + // 1. Exact domain names: ``www.foo.com``. + // 2. Suffix domain wildcards: ``*.foo.com`` or ``*-bar.foo.com``. + // 3. Prefix domain wildcards: ``foo.*`` or ``foo-*``. + // 4. Special wildcard ``*`` matching any domain. // // .. note:: // // The wildcard will not match the empty string. // e.g. ``*-bar.foo.com`` will match ``baz-bar.foo.com`` but not ``-bar.foo.com``. - // Additionally, a special entry ``*`` is allowed which will match any - // host/authority header. Only a single virtual host in the entire route - // configuration can match on ``*``. A domain must be unique across all virtual - // hosts or the config will fail to load. + // The longest wildcards match first. + // Only a single virtual host in the entire route configuration can match on ``*``. A domain + // must be unique across all virtual hosts or the config will fail to load. repeated string domains = 2 [(validate.rules).repeated .min_items = 1]; // The list of routes that will be matched, in order, for incoming requests.