Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Removed Config or Runtime
*Normally occurs at the end of the* :ref:`deprecation period <deprecated>`

* compression: removed ``envoy.reloadable_features.enable_compression_without_content_length_header`` runtime guard and legacy code paths.
* http: removed ``envoy.reloadable_features.dont_add_content_length_for_bodiless_requests deprecation`` and legacy code paths.
* http: removed ``envoy.reloadable_features.return_502_for_upstream_protocol_errors``. Envoy will always return 502 code upon encountering upstream protocol error.
* http: removed ``envoy.reloadable_features.treat_upstream_connect_timeout_as_connect_failure`` and legacy code paths.

Expand Down
4 changes: 1 addition & 3 deletions source/common/http/http1/codec_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ void StreamEncoderImpl::encodeHeadersBase(const RequestOrResponseHeaderMap& head
// Also do not add content length for requests which should not have a
// body, per https://tools.ietf.org/html/rfc7230#section-3.3.2
if (!status || (*status >= 200 && *status != 204)) {
if (!bodiless_request ||
!Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.dont_add_content_length_for_bodiless_requests")) {
if (!bodiless_request) {
encodeFormattedHeader(header_values.ContentLength.get(), "0", formatter);
}
}
Expand Down
1 change: 0 additions & 1 deletion source/common/runtime/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ constexpr const char* runtime_features[] = {
"envoy.reloadable_features.conn_pool_delete_when_idle",
"envoy.reloadable_features.correct_scheme_and_xfp",
"envoy.reloadable_features.disable_tls_inspector_injection",
"envoy.reloadable_features.dont_add_content_length_for_bodiless_requests",
"envoy.reloadable_features.fix_added_trailers",
"envoy.reloadable_features.grpc_bridge_stats_disabled",
"envoy.reloadable_features.grpc_web_fix_non_proto_encoded_response_handling",
Expand Down
19 changes: 0 additions & 19 deletions test/common/http/http1/codec_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2260,25 +2260,6 @@ TEST_F(Http1ClientConnectionImplTest, SimpleGetWithHeaderCasing) {
EXPECT_EQ("GET / HTTP/1.1\r\nMy-Custom-Header: hey\r\n\r\n", output);
}

TEST_F(Http1ClientConnectionImplTest, SimpleGetWithHeaderCasingLegacy) {
TestScopedRuntime scoped_runtime;
Runtime::LoaderSingleton::getExisting()->mergeValues(
{{"envoy.reloadable_features.dont_add_content_length_for_bodiless_requests", "false"}});
codec_settings_.header_key_format_ = Http1Settings::HeaderKeyFormat::ProperCase;

initialize();

MockResponseDecoder response_decoder;
Http::RequestEncoder& request_encoder = codec_->newStream(response_decoder);

std::string output;
ON_CALL(connection_, write(_, _)).WillByDefault(AddBufferToString(&output));

TestRequestHeaderMapImpl headers{{":method", "GET"}, {":path", "/"}, {"my-custom-header", "hey"}};
EXPECT_TRUE(request_encoder.encodeHeaders(headers, true).ok());
EXPECT_EQ("GET / HTTP/1.1\r\nMy-Custom-Header: hey\r\nContent-Length: 0\r\n\r\n", output);
}

TEST_F(Http1ClientConnectionImplTest, HostHeaderTranslate) {
initialize();

Expand Down
2 changes: 0 additions & 2 deletions test/integration/protocol_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ TEST_P(DownstreamProtocolIntegrationTest, RouterRedirect) {
}

TEST_P(ProtocolIntegrationTest, UnknownResponsecode) {
config_helper_.addRuntimeOverride(
"envoy.reloadable_features.dont_add_content_length_for_bodiless_requests", "true");
initialize();

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