Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: remove deprecated connection_header_sanitization runtime guard #12500

Merged
merged 1 commit into from
Aug 17, 2020
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 @@ -42,6 +42,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 @@ -448,8 +448,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 @@ -848,7 +846,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.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,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
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.allow_500_after_100",
Expand Down