From 51e716ef545f0cb2bb8f54a3bb77ae9f94ca28bc Mon Sep 17 00:00:00 2001 From: Denis Mishin Date: Mon, 16 May 2022 18:22:20 -0400 Subject: [PATCH] add x-request-id in responses (#3366) --- config/envoyconfig/listeners.go | 2 ++ config/envoyconfig/listeners_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/config/envoyconfig/listeners.go b/config/envoyconfig/listeners.go index e19090927..cf48ab727 100644 --- a/config/envoyconfig/listeners.go +++ b/config/envoyconfig/listeners.go @@ -441,6 +441,8 @@ func (b *Builder) buildMainHTTPConnectionManagerFilter( return nil, err } tc := marshalAny(&envoy_http_connection_manager.HttpConnectionManager{ + AlwaysSetRequestIdInResponse: true, + CodecType: options.GetCodecType().ToEnvoy(), StatPrefix: "ingress", RouteSpecifier: &envoy_http_connection_manager.HttpConnectionManager_RouteConfig{ diff --git a/config/envoyconfig/listeners_test.go b/config/envoyconfig/listeners_test.go index 5114ad9d0..348009fd8 100644 --- a/config/envoyconfig/listeners_test.go +++ b/config/envoyconfig/listeners_test.go @@ -134,6 +134,7 @@ func Test_buildMainHTTPConnectionManagerFilter(t *testing.T) { } } }], + "alwaysSetRequestIdInResponse": true, "codecType": "HTTP1", "commonHttpProtocolOptions": { "idleTimeout": "300s"