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 <bartebor@wp.pl>

Mirrored from https://github.com/envoyproxy/envoy @ af7c845fc5e37ce5b271e1a7b4566f2d1e8ec290
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 5f91d81912
commit 7d5ffd0425
  1. 16
      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.

Loading…
Cancel
Save