Skip to content

Commit

Permalink
internal/envoy: Update GZip to valid wellknown name
Browse files Browse the repository at this point in the history
Updates: #2479

Signed-off-by: Steve Sloka <[email protected]>
  • Loading branch information
stevesloka committed Sep 18, 2020
1 parent c5ff6f3 commit 5eaaf79
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
12 changes: 7 additions & 5 deletions internal/envoy/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ import (
type HTTPVersionType = http.HttpConnectionManager_CodecType

const (
HTTPVersionAuto HTTPVersionType = http.HttpConnectionManager_AUTO
HTTPVersion1 HTTPVersionType = http.HttpConnectionManager_HTTP1
HTTPVersion2 HTTPVersionType = http.HttpConnectionManager_HTTP2
HTTPVersion3 HTTPVersionType = http.HttpConnectionManager_HTTP3
HTTPVersionAuto HTTPVersionType = http.HttpConnectionManager_AUTO
HTTPVersion1 HTTPVersionType = http.HttpConnectionManager_HTTP1
HTTPVersion2 HTTPVersionType = http.HttpConnectionManager_HTTP2
HTTPVersion3 HTTPVersionType = http.HttpConnectionManager_HTTP3
gzipHttpFilterName = "envoy.filters.http.compressor"
)

// TLSInspector returns a new TLS inspector listener filter.
Expand Down Expand Up @@ -204,7 +205,8 @@ func (b *httpConnectionManagerBuilder) ConnectionShutdownGracePeriod(timeout tim
func (b *httpConnectionManagerBuilder) DefaultFilters() *httpConnectionManagerBuilder {
b.filters = append(b.filters,
&http.HttpFilter{
Name: wellknown.Gzip,
// TODO(#2479) Update once go-control-plane constant is merged (https://github.com/envoyproxy/go-control-plane/pull/354).
Name: gzipHttpFilterName,
},
&http.HttpFilter{
Name: wellknown.GRPCWeb,
Expand Down
14 changes: 7 additions & 7 deletions internal/envoy/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func TestHTTPConnectionManager(t *testing.T) {
},
},
HttpFilters: []*http.HttpFilter{{
Name: wellknown.Gzip,
Name: gzipHttpFilterName,
}, {
Name: wellknown.GRPCWeb,
}, {
Expand Down Expand Up @@ -388,7 +388,7 @@ func TestHTTPConnectionManager(t *testing.T) {
},
},
HttpFilters: []*http.HttpFilter{{
Name: wellknown.Gzip,
Name: gzipHttpFilterName,
}, {
Name: wellknown.GRPCWeb,
}, {
Expand Down Expand Up @@ -439,7 +439,7 @@ func TestHTTPConnectionManager(t *testing.T) {
},
},
HttpFilters: []*http.HttpFilter{{
Name: wellknown.Gzip,
Name: gzipHttpFilterName,
}, {
Name: wellknown.GRPCWeb,
}, {
Expand Down Expand Up @@ -491,7 +491,7 @@ func TestHTTPConnectionManager(t *testing.T) {
},
},
HttpFilters: []*http.HttpFilter{{
Name: wellknown.Gzip,
Name: gzipHttpFilterName,
}, {
Name: wellknown.GRPCWeb,
}, {
Expand Down Expand Up @@ -542,7 +542,7 @@ func TestHTTPConnectionManager(t *testing.T) {
},
},
HttpFilters: []*http.HttpFilter{{
Name: wellknown.Gzip,
Name: gzipHttpFilterName,
}, {
Name: wellknown.GRPCWeb,
}, {
Expand Down Expand Up @@ -594,7 +594,7 @@ func TestHTTPConnectionManager(t *testing.T) {
},
},
HttpFilters: []*http.HttpFilter{{
Name: wellknown.Gzip,
Name: gzipHttpFilterName,
}, {
Name: wellknown.GRPCWeb,
}, {
Expand Down Expand Up @@ -644,7 +644,7 @@ func TestHTTPConnectionManager(t *testing.T) {
},
},
HttpFilters: []*http.HttpFilter{{
Name: wellknown.Gzip,
Name: gzipHttpFilterName,
}, {
Name: wellknown.GRPCWeb,
}, {
Expand Down

0 comments on commit 5eaaf79

Please sign in to comment.