diff --git a/internal/envoy/v3/listener.go b/internal/envoy/v3/listener.go index b1ef7ecfd02..29dfaab9e08 100644 --- a/internal/envoy/v3/listener.go +++ b/internal/envoy/v3/listener.go @@ -556,10 +556,10 @@ func (b *httpConnectionManagerBuilder) Get() *envoy_config_listener_v3.Filter { cm.CommonHttpProtocolOptions.MaxRequestsPerConnection = wrapperspb.UInt32(*b.maxRequestsPerConnection) } + http2Options := &envoy_config_core_v3.Http2ProtocolOptions{} + if b.http2MaxConcurrentStreams != nil { - cm.Http2ProtocolOptions = &envoy_config_core_v3.Http2ProtocolOptions{ - MaxConcurrentStreams: wrapperspb.UInt32(*b.http2MaxConcurrentStreams), - } + http2Options.MaxConcurrentStreams = wrapperspb.UInt32(*b.http2MaxConcurrentStreams) } if b.enableWebsockets { @@ -568,7 +568,12 @@ func (b *httpConnectionManagerBuilder) Get() *envoy_config_listener_v3.Filter { UpgradeType: "websocket", }, ) - cm.Http2ProtocolOptions.AllowConnect = true + http2Options.AllowConnect = true + } + + // Assign http2Options only if it has been modified + if b.http2MaxConcurrentStreams != nil { + cm.Http2ProtocolOptions = http2Options } return &envoy_config_listener_v3.Filter{