Skip to content

Commit afbe0c3

Browse files
committed
runtime: deprecate sanitize_te
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
1 parent a3503a3 commit afbe0c3

File tree

6 files changed

+3
-95
lines changed

6 files changed

+3
-95
lines changed

changelogs/current.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ removed_config_or_runtime:
162162
- area: dns
163163
change: |
164164
Removed runtime flag ``envoy.reloadable_features.dns_reresolve_on_eai_again`` and legacy code paths.
165+
- area: http
166+
change: |
167+
Removed runtime flag ``envoy.restart_features.sanitize_te`` and legacy code paths.
165168
- area: quic
166169
change: |
167170
Removed runtime flag ``envoy.restart_features.quic_handle_certs_with_shared_tls_code`` and legacy code paths.

source/common/http/conn_manager_utility.cc

-4
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,6 @@ ConnectionManagerUtility::MutateRequestHeadersResult ConnectionManagerUtility::m
295295
}
296296

297297
void ConnectionManagerUtility::sanitizeTEHeader(RequestHeaderMap& request_headers) {
298-
if (!Runtime::runtimeFeatureEnabled("envoy.reloadable_features.sanitize_te")) {
299-
return;
300-
}
301-
302298
absl::string_view te_header = request_headers.getTEValue();
303299
if (te_header.empty()) {
304300
return;

source/common/runtime/runtime_features.cc

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ RUNTIME_GUARD(envoy_reloadable_features_reject_invalid_yaml);
8686
RUNTIME_GUARD(envoy_reloadable_features_report_stream_reset_error_code);
8787
RUNTIME_GUARD(envoy_reloadable_features_sanitize_http2_headers_without_nghttp2);
8888
RUNTIME_GUARD(envoy_reloadable_features_sanitize_sni_in_access_log);
89-
RUNTIME_GUARD(envoy_reloadable_features_sanitize_te);
9089
RUNTIME_GUARD(envoy_reloadable_features_skip_dns_lookup_for_proxied_requests);
9190
RUNTIME_GUARD(envoy_reloadable_features_streaming_shadow);
9291
RUNTIME_GUARD(envoy_reloadable_features_strict_duration_validation);

test/common/http/conn_manager_utility_test.cc

-12
Original file line numberDiff line numberDiff line change
@@ -2299,17 +2299,5 @@ TEST_F(ConnectionManagerUtilityTest, DiscardTEHeaderWithoutTrailers) {
22992299
EXPECT_EQ("", headers.getTEValue());
23002300
}
23012301

2302-
// Verify when TE header is present, the value should be kept if the reloadable feature
2303-
// "sanitize_te" is enabled.
2304-
TEST_F(ConnectionManagerUtilityTest, KeepTrailersTEHeaderReloadableFeatureDisabled) {
2305-
TestScopedRuntime scoped_runtime;
2306-
scoped_runtime.mergeValues({{"envoy.reloadable_features.sanitize_te", "false"}});
2307-
2308-
TestRequestHeaderMapImpl headers{{"te", "gzip"}};
2309-
callMutateRequestHeaders(headers, Protocol::Http2);
2310-
2311-
EXPECT_EQ("gzip", headers.getTEValue());
2312-
}
2313-
23142302
} // namespace Http
23152303
} // namespace Envoy

test/integration/header_integration_test.cc

-72
Original file line numberDiff line numberDiff line change
@@ -1339,78 +1339,6 @@ TEST_P(HeaderIntegrationTest, PathWithEscapedSlashesRedirected) {
13391339
});
13401340
}
13411341

1342-
// Validates legacy TE handling: TE header is forwarded if it contains a supported value
1343-
TEST_P(HeaderIntegrationTest, TestTeHeaderPassthrough) {
1344-
config_helper_.addRuntimeOverride("envoy.reloadable_features.sanitize_te", "false");
1345-
initializeFilter(HeaderMode::Append, false);
1346-
performRequest(
1347-
Http::TestRequestHeaderMapImpl{
1348-
{":method", "GET"},
1349-
{":path", "/"},
1350-
{":scheme", "http"},
1351-
{":authority", "no-headers.com"},
1352-
{"x-request-foo", "downstram"},
1353-
{"connection", "te, close"},
1354-
{"te", "trailers"},
1355-
},
1356-
Http::TestRequestHeaderMapImpl{
1357-
{":authority", "no-headers.com"},
1358-
{":path", "/"},
1359-
{":method", "GET"},
1360-
{"x-request-foo", "downstram"},
1361-
{"te", "trailers"},
1362-
},
1363-
Http::TestResponseHeaderMapImpl{
1364-
{"server", "envoy"},
1365-
{"content-length", "0"},
1366-
{":status", "200"},
1367-
{"x-return-foo", "upstream"},
1368-
},
1369-
Http::TestResponseHeaderMapImpl{
1370-
{"server", "envoy"},
1371-
{"x-return-foo", "upstream"},
1372-
{":status", "200"},
1373-
{"connection", "close"},
1374-
});
1375-
}
1376-
1377-
// Validates legacy TE handling: that TE header stripped if it contains an unsupported value.
1378-
TEST_P(HeaderIntegrationTest, TestTeHeaderSanitized) {
1379-
config_helper_.addRuntimeOverride("envoy.reloadable_features.sanitize_te", "false");
1380-
initializeFilter(HeaderMode::Append, false);
1381-
performRequest(
1382-
Http::TestRequestHeaderMapImpl{
1383-
{":method", "GET"},
1384-
{":path", "/"},
1385-
{":scheme", "http"},
1386-
{":authority", "no-headers.com"},
1387-
{"x-request-foo", "downstram"},
1388-
{"connection", "te, mike, sam, will, close"},
1389-
{"te", "gzip"},
1390-
{"mike", "foo"},
1391-
{"sam", "bar"},
1392-
{"will", "baz"},
1393-
},
1394-
Http::TestRequestHeaderMapImpl{
1395-
{":authority", "no-headers.com"},
1396-
{":path", "/"},
1397-
{":method", "GET"},
1398-
{"x-request-foo", "downstram"},
1399-
},
1400-
Http::TestResponseHeaderMapImpl{
1401-
{"server", "envoy"},
1402-
{"content-length", "0"},
1403-
{":status", "200"},
1404-
{"x-return-foo", "upstream"},
1405-
},
1406-
Http::TestResponseHeaderMapImpl{
1407-
{"server", "envoy"},
1408-
{"x-return-foo", "upstream"},
1409-
{":status", "200"},
1410-
{"connection", "close"},
1411-
});
1412-
}
1413-
14141342
using EmptyHeaderIntegrationTest = HttpProtocolIntegrationTest;
14151343
using HeaderValueOption = envoy::config::core::v3::HeaderValueOption;
14161344

test/integration/protocol_integration_test.cc

-6
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,6 @@ TEST_P(DownstreamProtocolIntegrationTest, TeSanitization) {
792792
}
793793

794794
autonomous_upstream_ = true;
795-
config_helper_.addRuntimeOverride("envoy.reloadable_features.sanitize_te", "true");
796-
797795
default_request_headers_.setTE("gzip");
798796

799797
initialize();
@@ -815,8 +813,6 @@ TEST_P(DownstreamProtocolIntegrationTest, TeSanitizationTrailers) {
815813
}
816814

817815
autonomous_upstream_ = true;
818-
config_helper_.addRuntimeOverride("envoy.reloadable_features.sanitize_te", "true");
819-
820816
default_request_headers_.setTE("trailers");
821817

822818
initialize();
@@ -838,8 +834,6 @@ TEST_P(DownstreamProtocolIntegrationTest, TeSanitizationTrailersMultipleValuesAn
838834
}
839835

840836
autonomous_upstream_ = true;
841-
config_helper_.addRuntimeOverride("envoy.reloadable_features.sanitize_te", "true");
842-
843837
default_request_headers_.setTE("chunked;q=0.8 , trailers ,deflate ");
844838

845839
initialize();

0 commit comments

Comments
 (0)