diff --git a/config/200-bootstrap.yaml b/config/200-bootstrap.yaml index 1b9665959..ce70dfb3a 100644 --- a/config/200-bootstrap.yaml +++ b/config/200-bootstrap.yaml @@ -65,11 +65,11 @@ data: routes: - match: safe_regex: - google_re2: {} regex: '/(certs|stats(/prometheus)?|server_info|clusters|listeners|ready)?' headers: - name: ':method' - exact_match: GET + string_match: + exact: GET route: cluster: service_stats clusters: diff --git a/pkg/envoy/api/headers.go b/pkg/envoy/api/headers.go index a91d56831..4983328ca 100644 --- a/pkg/envoy/api/headers.go +++ b/pkg/envoy/api/headers.go @@ -18,7 +18,6 @@ package envoy import ( core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" - "google.golang.org/protobuf/types/known/wrapperspb" ) // headersToAdd generates a list of HeaderValueOption from a map of headers. @@ -36,7 +35,7 @@ func headersToAdd(headers map[string]string) []*core.HeaderValueOption { }, // In Knative Serving, headers are set instead of appended. // Ref: https://github.com/knative/serving/pull/6366 - Append: wrapperspb.Bool(false), + AppendAction: core.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, }) } diff --git a/pkg/envoy/api/headers_test.go b/pkg/envoy/api/headers_test.go index 9acec2ec3..2e3d3048d 100644 --- a/pkg/envoy/api/headers_test.go +++ b/pkg/envoy/api/headers_test.go @@ -22,7 +22,6 @@ import ( core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" "google.golang.org/protobuf/testing/protocmp" - "google.golang.org/protobuf/types/known/wrapperspb" "gotest.tools/v3/assert" ) @@ -50,13 +49,13 @@ func TestHeadersToAdd(t *testing.T) { Key: "foo", Value: "bar", }, - Append: wrapperspb.Bool(false), + AppendAction: core.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, }, { Header: &core.HeaderValue{ Key: "baz", Value: "lol", }, - Append: wrapperspb.Bool(false), + AppendAction: core.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, }}, }} diff --git a/pkg/envoy/api/weighted_cluster_test.go b/pkg/envoy/api/weighted_cluster_test.go index 1a5c35c3c..571528167 100644 --- a/pkg/envoy/api/weighted_cluster_test.go +++ b/pkg/envoy/api/weighted_cluster_test.go @@ -38,7 +38,7 @@ func TestNewWeightedCluster(t *testing.T) { Key: "foo", Value: "bar", }, - Append: wrapperspb.Bool(false), + AppendAction: core.HeaderValueOption_OVERWRITE_IF_EXISTS_OR_ADD, }}, }