diff --git a/enroute-dp/internal/envoy/listener_filter_helper.go b/enroute-dp/internal/envoy/listener_filter_helper.go index d417516..dabdc40 100644 --- a/enroute-dp/internal/envoy/listener_filter_helper.go +++ b/enroute-dp/internal/envoy/listener_filter_helper.go @@ -12,6 +12,10 @@ import ( "github.com/saarasio/enroute/enroute-dp/internal/dag" cfg "github.com/saarasio/enroute/enroute-dp/saarasconfig" "github.com/saarasio/enroute/enroute-dp/saarasfilters" + http "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" + envoy_compressor_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/compressor/v3" + envoy_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + "github.com/golang/protobuf/ptypes/any" ) func DagFilterToHttpFilter(df *dag.HttpFilter, vh *dag.VirtualHost) *envoy_extensions_filters_network_http_connection_manager_v3.HttpFilter { @@ -95,8 +99,17 @@ func httpFilters(vh *dag.Vertex) []*envoy_extensions_filters_network_http_connec http_filters = append(http_filters, &envoy_extensions_filters_network_http_connection_manager_v3.HttpFilter{ - Name: wellknown.Gzip, - ConfigType: nil, + Name: "compressor", + ConfigType: &http.HttpFilter_TypedConfig{ + TypedConfig: toAny(&envoy_compressor_v3.Compressor{ + CompressorLibrary: &envoy_core_v3.TypedExtensionConfig{ + Name: "gzip", + TypedConfig: &any.Any{ + TypeUrl: cfg.HTTPFilterGzip, + }, + }, + }), + }, }) http_filters = append(http_filters, diff --git a/enroute-dp/internal/envoy/listener_test.go b/enroute-dp/internal/envoy/listener_test.go index 89b8e53..4ad5e7f 100644 --- a/enroute-dp/internal/envoy/listener_test.go +++ b/enroute-dp/internal/envoy/listener_test.go @@ -34,6 +34,11 @@ import ( "google.golang.org/protobuf/testing/protocmp" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" + http "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" + envoy_compressor_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/compressor/v3" + envoy_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" + "github.com/golang/protobuf/ptypes/any" + cfg "github.com/saarasio/enroute/enroute-dp/saarasconfig" ) func TestListener(t *testing.T) { @@ -247,8 +252,17 @@ func TestHTTPConnectionManager(t *testing.T) { }, }, HttpFilters: []*envoy_extensions_filters_network_http_connection_manager_v3.HttpFilter{{ - Name: wellknown.Gzip, - ConfigType: nil, + Name: "compressor", + ConfigType: &http.HttpFilter_TypedConfig{ + TypedConfig: toAny(&envoy_compressor_v3.Compressor{ + CompressorLibrary: &envoy_core_v3.TypedExtensionConfig{ + Name: "gzip", + TypedConfig: &any.Any{ + TypeUrl: cfg.HTTPFilterGzip, + }, + }, + }), + }, }, { Name: wellknown.GRPCWeb, ConfigType: nil,