Skip to content

Commit

Permalink
Fix code logic
Browse files Browse the repository at this point in the history
Signed-off-by: Rajat Vig <[email protected]>
  • Loading branch information
rajatvig committed Jan 12, 2025
1 parent 337b24a commit 0da4d80
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions internal/envoy/v3/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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{
Expand Down

0 comments on commit 0da4d80

Please sign in to comment.