Skip to content

Commit

Permalink
allow "trailers"
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael DEMACON <ndemacon@scaleway.com>
  • Loading branch information
quantumsheep committed Feb 9, 2024
1 parent cfe8dd4 commit afc5512
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions source/common/http/conn_manager_utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ ConnectionManagerUtility::MutateRequestHeadersResult ConnectionManagerUtility::m
request_headers.removeUpgrade();

if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.sanitize_te")) {
if (Grpc::Common::isGrpcRequestHeaders(request_headers)) {
request_headers.setTE(Http::Headers::get().TEValues.Trailers);
} else {
if (request_headers.TE() != Http::Headers::get().TEValues.Trailers) {
request_headers.removeTE();
}
}
Expand Down
5 changes: 2 additions & 3 deletions test/integration/protocol_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -809,16 +809,15 @@ TEST_P(DownstreamProtocolIntegrationTest, TeSanitization) {
EXPECT_EQ("", upstream_headers->getTEValue());
}

TEST_P(DownstreamProtocolIntegrationTest, TeSanitizationGrpc) {
TEST_P(DownstreamProtocolIntegrationTest, TeSanitizationTrailers) {
if (downstreamProtocol() != Http::CodecType::HTTP1) {
return;
}

autonomous_upstream_ = true;
config_helper_.addRuntimeOverride("envoy.reloadable_features.sanitize_te", "true");

default_request_headers_.setTE("gzip");
default_request_headers_.setContentType("application/grpc");
default_request_headers_.setTE("trailers");

initialize();
codec_client_ = makeHttpConnection(lookupPort("http"));
Expand Down

0 comments on commit afc5512

Please sign in to comment.