http: making the behavior of the response Server header configurable (#8014)

Default behavior remains unchanged, but now Envoy can override, override iff there's no server header from upstream, or always leave the server header (or lack thereof) unmodified.

Risk Level: low (config guarded change)
Testing: new unit tests
Docs Changes: n/a
Release Notes: inline
Fixes #6716

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>

Mirrored from https://github.com/envoyproxy/envoy @ b8966cbbfff4566b08eaed7b2b060a6c12eec168
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 0cb19a8b12
commit 5ed543e416
  1. 20
      envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto

@ -25,7 +25,7 @@ import "gogoproto/gogo.proto";
// [#protodoc-title: HTTP connection manager]
// HTTP connection manager :ref:`configuration overview <config_http_conn_man>`.
// [#comment:next free field: 34]
// [#comment:next free field: 35]
message HttpConnectionManager {
enum CodecType {
option (gogoproto.goproto_enum_prefix) = false;
@ -144,6 +144,24 @@ message HttpConnectionManager {
// header in responses. If not set, the default is *envoy*.
string server_name = 10;
enum ServerHeaderTransformation {
option (gogoproto.goproto_enum_prefix) = false;
// Overwrite any Server header with the contents of server_name.
OVERWRITE = 0;
// If no Server header is present, append Server server_name
// If a Server header is present, pass it through.
APPEND_IF_ABSENT = 1;
// Pass through the value of the server header, and do not append a header
// if none is present.
PASS_THROUGH = 2;
}
// Defines the action to be applied to the Server header on the response path.
// By default, Envoy will overwrite the header with the value specified in
// server_name.
ServerHeaderTransformation server_header_transformation = 34
[(validate.rules).enum.defined_only = true];
// The maximum request headers size for incoming connections.
// If unconfigured, the default max request headers allowed is 60 KiB.
// Requests that exceed this limit will receive a 431 response.

Loading…
Cancel
Save