From 0a7d55ad12630ebcb453e4231539a993b55cb948 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Fri, 8 May 2020 18:12:26 +0000 Subject: [PATCH] conn_manager: allow to remove port from host header (#10960) add an api option/conn manager feature which would allow to remove port part from Host header (e.g. would transform example:443 to example. this would simplify domain's matching inside virtual host as well as would not require explicit matching on "domain:port" in upstream proxies. Signed-off-by: Nikita V. Shirokov Mirrored from https://github.com/envoyproxy/envoy @ 111684faa1d28f34fb16af43911c575c6815c450 --- .../v3/http_connection_manager.proto | 10 +++++++++- .../v4alpha/http_connection_manager.proto | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto index 92b2d8b9..a236c5c4 100644 --- a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto +++ b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto @@ -30,7 +30,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // HTTP connection manager :ref:`configuration overview `. // [#extension: envoy.filters.network.http_connection_manager] -// [#next-free-field: 39] +// [#next-free-field: 40] message HttpConnectionManager { option (udpa.annotations.versioning).previous_message_type = "envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager"; @@ -511,6 +511,14 @@ message HttpConnectionManager { // host will not be overwritten by the HTTP Connection Manager. The default behaviour is // to overwrite the `date` header unconditionally. bool preserve_upstream_date = 38; + + // Determines if the port part should be removed from host/authority header before any processing + // of request by HTTP filters or routing. The port would be removed only if it is equal to the :ref:`listener's` + // local port and request method is not CONNECT. This affects the upstream host header as well. + // Without setting this option, incoming requests with host `example:443` will not match against + // route with :ref:`domains` match set to `example`. Defaults to `false`. Note that port removal is not part + // of `HTTP spec ` and is provided for convenience. + bool strip_matching_host_port = 39; } message Rds { diff --git a/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto b/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto index 8e16ecd6..6e26aa2d 100644 --- a/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto +++ b/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto @@ -30,7 +30,7 @@ option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSIO // HTTP connection manager :ref:`configuration overview `. // [#extension: envoy.filters.network.http_connection_manager] -// [#next-free-field: 39] +// [#next-free-field: 40] message HttpConnectionManager { option (udpa.annotations.versioning).previous_message_type = "envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"; @@ -511,6 +511,14 @@ message HttpConnectionManager { // host will not be overwritten by the HTTP Connection Manager. The default behaviour is // to overwrite the `date` header unconditionally. bool preserve_upstream_date = 38; + + // Determines if the port part should be removed from host/authority header before any processing + // of request by HTTP filters or routing. The port would be removed only if it is equal to the :ref:`listener's` + // local port and request method is not CONNECT. This affects the upstream host header as well. + // Without setting this option, incoming requests with host `example:443` will not match against + // route with :ref:`domains` match set to `example`. Defaults to `false`. Note that port removal is not part + // of `HTTP spec ` and is provided for convenience. + bool strip_matching_host_port = 39; } message Rds {