router: add regex substitution to header hashing (#11819)

Extend hashing via header to support regex substitution.

This is useful when you need to hash on a transformation
of a header value (e.g.: extract a part of `:path`).

Fixes #11811

Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>

Mirrored from https://github.com/envoyproxy/envoy @ 73fc620a34135a16070083f3c94b93d074f6e59f
master-ci-test
data-plane-api(CircleCI) 4 years ago
parent 00f42dcbd7
commit 92c9e8dd1c
  1. 4
      envoy/config/route/v3/route_components.proto
  2. 4
      envoy/config/route/v4alpha/route_components.proto

@ -615,6 +615,10 @@ message RouteAction {
string header_name = 1 [
(validate.rules).string = {min_bytes: 1 well_known_regex: HTTP_HEADER_NAME strict: false}
];
// If specified, the request header value will be rewritten and used
// to produce the hash key.
type.matcher.v3.RegexMatchAndSubstitute regex_rewrite = 2;
}
// Envoy supports two types of cookie affinity:

@ -608,6 +608,10 @@ message RouteAction {
string header_name = 1 [
(validate.rules).string = {min_bytes: 1 well_known_regex: HTTP_HEADER_NAME strict: false}
];
// If specified, the request header value will be rewritten and used
// to produce the hash key.
type.matcher.v4alpha.RegexMatchAndSubstitute regex_rewrite = 2;
}
// Envoy supports two types of cookie affinity:

Loading…
Cancel
Save