diff --git a/config/envoyconfig/listeners_test.go b/config/envoyconfig/listeners_test.go index 6db5a70b3..86c9f5774 100644 --- a/config/envoyconfig/listeners_test.go +++ b/config/envoyconfig/listeners_test.go @@ -134,6 +134,7 @@ func Test_buildMainHTTPConnectionManagerFilter(t *testing.T) { } } }], + "codecType": "HTTP1", "commonHttpProtocolOptions": { "idleTimeout": "300s" }, diff --git a/config/options.go b/config/options.go index d4966a9cd..5f253fc32 100644 --- a/config/options.go +++ b/config/options.go @@ -312,6 +312,7 @@ var defaultOptions = Options{ Services: "all", CookieHTTPOnly: true, CookieSecure: true, + CodecType: CodecTypeAuto, CookieExpire: 14 * time.Hour, CookieName: "_pomerium", DefaultUpstreamTimeout: 30 * time.Second, diff --git a/config/options_test.go b/config/options_test.go index 2470c6ac6..ccc6ecf8b 100644 --- a/config/options_test.go +++ b/config/options_test.go @@ -313,6 +313,7 @@ func TestOptionsFromViper(t *testing.T) { EnvoyAdminAccessLogPath: os.DevNull, EnvoyAdminProfilePath: os.DevNull, EnvoyAdminAddress: "127.0.0.1:9901", + CodecType: CodecTypeAuto, }, false, }, @@ -334,6 +335,7 @@ func TestOptionsFromViper(t *testing.T) { EnvoyAdminAccessLogPath: os.DevNull, EnvoyAdminProfilePath: os.DevNull, EnvoyAdminAddress: "127.0.0.1:9901", + CodecType: CodecTypeAuto, }, false, }, @@ -691,3 +693,8 @@ func mustParseWeightedURLs(t *testing.T, urls ...string) []WeightedURL { require.NoError(t, err) return wu } + +func TestDefaults(t *testing.T) { + o := NewDefaultOptions() + assert.Equal(t, CodecTypeAuto, o.CodecType) +}