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

runtime: removing treat host like authority guard #18584

Merged
merged 3 commits into from
Oct 13, 2021
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 @@ -26,6 +26,7 @@ Removed Config or Runtime
* http: removed ``envoy.reloadable_features.dont_add_content_length_for_bodiless_requests deprecation`` and legacy code paths.
* http: removed ``envoy.reloadable_features.improved_stream_limit_handling`` 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_host_like_authority`` and legacy code paths.
* http: removed ``envoy.reloadable_features.treat_upstream_connect_timeout_as_connect_failure`` and legacy code paths.

New Features
Expand Down
3 changes: 1 addition & 2 deletions source/common/http/header_utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,7 @@ bool HeaderUtility::isRemovableHeader(absl::string_view header) {

bool HeaderUtility::isModifiableHeader(absl::string_view header) {
return (header.empty() || header[0] != ':') &&
(!Runtime::runtimeFeatureEnabled("envoy.reloadable_features.treat_host_like_authority") ||
!absl::EqualsIgnoreCase(header, Headers::get().HostLegacy.get()));
!absl::EqualsIgnoreCase(header, Headers::get().HostLegacy.get());
}

HeaderUtility::HeaderValidationResult HeaderUtility::checkHeaderNameForUnderscores(
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 @@ -84,7 +84,6 @@ constexpr const char* runtime_features[] = {
"envoy.reloadable_features.require_strict_1xx_and_204_response_headers",
"envoy.reloadable_features.send_strict_1xx_and_204_response_headers",
"envoy.reloadable_features.strip_port_from_connect",
"envoy.reloadable_features.treat_host_like_authority",
"envoy.reloadable_features.udp_listener_updates_filter_chain_in_place",
"envoy.reloadable_features.udp_per_event_loop_read_limit",
"envoy.reloadable_features.unquote_log_string_values",
Expand Down
23 changes: 0 additions & 23 deletions test/common/router/config_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1710,29 +1710,6 @@ TEST_F(RouteMatcherTest, TestRequestHeadersToAddNoHostOrPseudoHeader) {
}
}

TEST_F(RouteMatcherTest, TestRequestHeadersToAddLegacyHostHeader) {
TestScopedRuntime scoped_runtime;
Runtime::LoaderSingleton::getExisting()->mergeValues(
{{"envoy.reloadable_features.treat_host_like_authority", "false"}});

const std::string yaml = R"EOF(
virtual_hosts:
- name: www2
domains: ["*"]
request_headers_to_add:
- header:
key: "host"
value: vhost-www2
append: false
)EOF";

NiceMock<Envoy::StreamInfo::MockStreamInfo> stream_info;

envoy::config::route::v3::RouteConfiguration route_config = parseRouteConfigurationFromYaml(yaml);

EXPECT_NO_THROW(TestConfigImpl config(route_config, factory_context_, true));
}

// Validate that we can't remove :-prefixed request headers.
TEST_F(RouteMatcherTest, TestRequestHeadersToRemoveNoPseudoHeader) {
for (const std::string& header :
Expand Down