Skip to content

Commit

Permalink
runtime: remove treat_host_like_authority (#18584)
Browse files Browse the repository at this point in the history
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
  • Loading branch information
alyssawilk authored Oct 13, 2021
1 parent 08d2573 commit b7393b0
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 26 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 @@ -29,6 +29,7 @@ Removed Config or Runtime
* http: removed ``envoy.reloadable_features.improved_stream_limit_handling`` and legacy code paths.
* http: removed ``envoy.reloadable_features.remove_forked_chromium_url`` 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.
* upstream: removed ``envoy.reloadable_features.upstream_host_weight_change_causes_rebuild`` and legacy code paths.

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 @@ -82,7 +82,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 @@ -1872,29 +1872,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

0 comments on commit b7393b0

Please sign in to comment.