Skip to content

Commit

Permalink
http: remove deprecated envoy.reloadable_features.connection_header_s…
Browse files Browse the repository at this point in the history
…anitization runtime guard (#12500)

http: Remove deprecated envoy.reloadable_features.connection_header_sanitization runtime guard

Signed-off-by: Alvin Baptiste [email protected]

Commit Message: http: remove deprecated runtime guard for connection header sanitization
Risk Level: Low
Testing: bazel test //test/...
Release Notes: Added
Fixes #11933
Removed: envoy.reloadable_features.connection_header_sanitization

Signed-off-by: Alvin Baptiste <[email protected]>
  • Loading branch information
abaptiste authored Aug 17, 2020
1 parent 49aedfd commit b9544c8
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Removed Config or Runtime
* http: removed legacy header sanitization and the runtime guard `envoy.reloadable_features.strict_header_validation`.
* http: removed legacy transfer-encoding enforcement and runtime guard `envoy.reloadable_features.reject_unsupported_transfer_encodings`.
* http: removed configurable strict host validation and runtime guard `envoy.reloadable_features.strict_authority_validation`.
* http: removed the connection header sanitization runtime guard `envoy.reloadable_features.connection_header_sanitization`.

New Features
------------
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 @@ -477,8 +477,6 @@ ConnectionImpl::ConnectionImpl(Network::Connection& connection, CodecStats& stat
: connection_(connection), stats_(stats),
header_key_formatter_(std::move(header_key_formatter)), processing_trailers_(false),
handling_upgrade_(false), reset_stream_called_(false), deferred_end_stream_headers_(false),
connection_header_sanitization_(Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.connection_header_sanitization")),
enable_trailers_(enable_trailers),
strict_1xx_and_204_headers_(Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.strict_1xx_and_204_response_headers")),
Expand Down Expand Up @@ -911,7 +909,7 @@ Envoy::StatusOr<int> ServerConnectionImpl::onHeadersComplete() {
ENVOY_CONN_LOG(trace, "Server: onHeadersComplete size={}", connection_, headers->size());
const char* method_string = http_method_str(static_cast<http_method>(parser_.method));

if (!handling_upgrade_ && connection_header_sanitization_ && headers->Connection()) {
if (!handling_upgrade_ && headers->Connection()) {
// If we fail to sanitize the request, return a 400 to the client
if (!Utility::sanitizeConnectionHeader(*headers)) {
absl::string_view header_value = headers->getConnectionValue();
Expand Down
1 change: 0 additions & 1 deletion source/common/http/http1/codec_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ class ConnectionImpl : public virtual Connection, protected Logger::Loggable<Log
// HTTP/1 message has been flushed from the parser. This allows raising an HTTP/2 style headers
// block with end stream set to true with no further protocol data remaining.
bool deferred_end_stream_headers_ : 1;
const bool connection_header_sanitization_ : 1;
const bool enable_trailers_ : 1;
const bool strict_1xx_and_204_headers_ : 1;
bool dispatching_ : 1;
Expand Down
4 changes: 1 addition & 3 deletions source/common/http/http1/codec_impl_legacy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,6 @@ ConnectionImpl::ConnectionImpl(Network::Connection& connection, CodecStats& stat
: connection_(connection), stats_(stats),
header_key_formatter_(std::move(header_key_formatter)), processing_trailers_(false),
handling_upgrade_(false), reset_stream_called_(false), deferred_end_stream_headers_(false),
connection_header_sanitization_(Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.connection_header_sanitization")),
enable_trailers_(enable_trailers),
strict_1xx_and_204_headers_(Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.strict_1xx_and_204_response_headers")),
Expand Down Expand Up @@ -853,7 +851,7 @@ int ServerConnectionImpl::onHeadersComplete() {
ENVOY_CONN_LOG(trace, "Server: onHeadersComplete size={}", connection_, headers->size());
const char* method_string = http_method_str(static_cast<http_method>(parser_.method));

if (!handling_upgrade_ && connection_header_sanitization_ && headers->Connection()) {
if (!handling_upgrade_ && headers->Connection()) {
// If we fail to sanitize the request, return a 400 to the client
if (!Utility::sanitizeConnectionHeader(*headers)) {
absl::string_view header_value = headers->getConnectionValue();
Expand Down
1 change: 0 additions & 1 deletion source/common/http/http1/codec_impl_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ class ConnectionImpl : public virtual Connection, protected Logger::Loggable<Log
// HTTP/1 message has been flushed from the parser. This allows raising an HTTP/2 style headers
// block with end stream set to true with no further protocol data remaining.
bool deferred_end_stream_headers_ : 1;
const bool connection_header_sanitization_ : 1;
const bool enable_trailers_ : 1;
const bool strict_1xx_and_204_headers_ : 1;

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 @@ -55,7 +55,6 @@ constexpr const char* runtime_features[] = {
// Enabled
"envoy.reloadable_features.http1_flood_protection",
"envoy.reloadable_features.test_feature_true",
"envoy.reloadable_features.connection_header_sanitization",
// Begin alphabetically sorted section.
"envoy.reloadable_features.activate_fds_next_event_loop",
"envoy.reloadable_features.activate_timers_next_event_loop",
Expand Down

0 comments on commit b9544c8

Please sign in to comment.