http: add support for removing request headers. (#4431)

While there, move header modification in some tests from
route action level (deprecated in #3838) to route level.

*Risk Level*: Low
*Testing*: bazel test //test/...
*Docs Changes*: Added
*Release Notes*: Added

Fixes #4249.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 6ce3e1f45005c37e4a951470ee0bcf0381738e76
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 2222918be2
commit 8524151725
  1. 5
      envoy/api/v2/core/health_check.proto
  2. 5
      envoy/api/v2/rds.proto
  3. 15
      envoy/api/v2/route/route.proto

@ -73,6 +73,7 @@ message HealthCheck {
}
}
// [#comment:next free field: 9]
message HttpHealthCheck {
// The value of the host header in the HTTP health check request. If
// left empty (default value), the name of the cluster this health check is associated
@ -100,6 +101,10 @@ message HealthCheck {
// <config_http_conn_man_headers_custom_request_headers>`.
repeated core.HeaderValueOption request_headers_to_add = 6;
// Specifies a list of HTTP headers that should be removed from each request that is sent to the
// health checked cluster.
repeated string request_headers_to_remove = 8;
// If set, health checks will be made using http/2.
bool use_http2 = 7;
}

@ -40,6 +40,7 @@ service RouteDiscoveryService {
}
}
// [#comment:next free field: 9]
message RouteConfiguration {
// The name of the route configuration. For example, it might match
// :ref:`route_config_name
@ -76,6 +77,10 @@ message RouteConfiguration {
// <config_http_conn_man_headers_custom_request_headers>`.
repeated core.HeaderValueOption request_headers_to_add = 6;
// Specifies a list of HTTP headers that should be removed from each request
// routed by the HTTP connection manager.
repeated string request_headers_to_remove = 8;
// An optional boolean that specifies whether the clusters that the route
// table refers to will be validated by the cluster manager. If set to true
// and a route refers to a non-existent cluster, the route table will not

@ -25,6 +25,7 @@ option (gogoproto.equal_all) = true;
// host header. This allows a single listener to service multiple top level domain path trees. Once
// a virtual host is selected based on the domain, the routes are processed in order to see which
// upstream cluster to route to or whether to perform a redirect.
// [#comment:next free field: 14]
message VirtualHost {
// The logical name of the virtual host. This is used when emitting certain
// statistics but is not relevant for routing.
@ -81,6 +82,10 @@ message VirtualHost {
// <config_http_conn_man_headers_custom_request_headers>`.
repeated core.HeaderValueOption request_headers_to_add = 7;
// Specifies a list of HTTP headers that should be removed from each request
// handled by this virtual host.
repeated string request_headers_to_remove = 13;
// Specifies a list of HTTP headers that should be added to each response
// handled by this virtual host. Headers specified at this level are applied
// after headers from enclosed :ref:`envoy_api_msg_route.Route` and before headers from the
@ -113,6 +118,7 @@ message VirtualHost {
//
// Envoy supports routing on HTTP method via :ref:`header matching
// <envoy_api_msg_route.HeaderMatcher>`.
// [#comment:next free field: 13]
message Route {
// Route matching parameters.
RouteMatch match = 1 [(validate.rules).message.required = true, (gogoproto.nullable) = false];
@ -157,6 +163,10 @@ message Route {
// <config_http_conn_man_headers_custom_request_headers>`.
repeated core.HeaderValueOption request_headers_to_add = 9;
// Specifies a list of HTTP headers that should be removed from each request
// matching this route.
repeated string request_headers_to_remove = 12;
// Specifies a set of headers that will be added to responses to requests
// matching this route. Headers specified at this level are applied before
// headers from the enclosing :ref:`envoy_api_msg_route.VirtualHost` and
@ -176,6 +186,7 @@ message Route {
// multiple upstream clusters along with weights that indicate the percentage of
// traffic to be forwarded to each cluster. The router selects an upstream cluster based on the
// weights.
// [#comment:next free field: 10]
message WeightedCluster {
message ClusterWeight {
// Name of the upstream cluster. The cluster must exist in the
@ -204,6 +215,10 @@ message WeightedCluster {
// <config_http_conn_man_headers_custom_request_headers>`.
repeated core.HeaderValueOption request_headers_to_add = 4;
// Specifies a list of HTTP headers that should be removed from each request when
// this cluster is selected through the enclosing :ref:`envoy_api_msg_route.RouteAction`.
repeated string request_headers_to_remove = 9;
// Specifies a list of headers to be added to responses when this cluster is selected
// through the enclosing :ref:`envoy_api_msg_route.RouteAction`.
// Headers specified at this level are applied before headers from the enclosing

Loading…
Cancel
Save