Skip to content

Commit

Permalink
http: set TE header to trailers instead of removing it
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 7, 2024
1 parent 5fede42 commit 2611451
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ date: Pending

behavior_changes:
# *Changes that are expected to cause an incompatibility if applicable; deployment changes are likely required*
- area: http
change: |
Force the hop by hop TE header from downstream request headers to "trailers". This change can be temporarily reverted
by setting ``envoy.reloadable_features.sanitize_te`` to false.
minor_behavior_changes:
# *Changes that may cause incompatibilities for some users, but should not for most*
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/conn_manager_utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ConnectionManagerUtility::MutateRequestHeadersResult ConnectionManagerUtility::m
request_headers.removeConnection();
request_headers.removeUpgrade();
if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.sanitize_te")) {
request_headers.removeTE();
request_headers.setTE(Http::Headers::get().TEValues.Trailers);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/protocol_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ TEST_P(DownstreamProtocolIntegrationTest, TeSanitization) {
auto upstream_headers =
reinterpret_cast<AutonomousUpstream*>(fake_upstreams_[0].get())->lastRequestHeaders();
EXPECT_TRUE(upstream_headers != nullptr);
EXPECT_EQ("", upstream_headers->getTEValue());
EXPECT_EQ("trailers", upstream_headers->getTEValue());
}

// Regression test for https://github.com/envoyproxy/envoy/issues/10270
Expand Down

0 comments on commit 2611451

Please sign in to comment.