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: removing envoy.reloadable_features.fix_upgrade_response #14706

Merged
merged 3 commits into from
Jan 20, 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 @@ -33,6 +33,7 @@ Removed Config or Runtime
* access_logs: removed legacy unbounded access logs and runtime guard `envoy.reloadable_features.disallow_unbounded_access_logs`.
* dynamic_forward_proxy: removed `envoy.reloadable_features.enable_dns_cache_circuit_breakers` and legacy code path.
* http: removed legacy HTTP/1.1 error reporting path and runtime guard `envoy.reloadable_features.early_errors_via_hcm`.
* http: removed legacy sanitization path for upgrade response headers and runtime guard `envoy.reloadable_features.fix_upgrade_response`.

New Features
------------
Expand Down
4 changes: 1 addition & 3 deletions source/common/http/conn_manager_utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,7 @@ void ConnectionManagerUtility::mutateResponseHeaders(ResponseHeaderMap& response
}
} else {
response_headers.removeConnection();
if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.fix_upgrade_response")) {
response_headers.removeUpgrade();
}
response_headers.removeUpgrade();
}

response_headers.removeTransferEncoding();
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 @@ -65,7 +65,6 @@ constexpr const char* runtime_features[] = {
"envoy.reloadable_features.consume_all_retry_headers",
"envoy.reloadable_features.check_ocsp_policy",
"envoy.reloadable_features.disable_tls_inspector_injection",
"envoy.reloadable_features.fix_upgrade_response",
"envoy.reloadable_features.fix_wildcard_matching",
"envoy.reloadable_features.fixed_connection_close",
"envoy.reloadable_features.hcm_stream_error_on_invalid_message",
Expand Down
36 changes: 0 additions & 36 deletions test/common/http/conn_manager_utility_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -801,42 +801,6 @@ TEST_F(ConnectionManagerUtilityTest, ClearUpgradeHeadersForNonUpgradeRequests) {
}
}

TEST_F(ConnectionManagerUtilityTest, ClearUpgradeHeadersForNonUpgradeRequestsLegacy) {
TestScopedRuntime scoped_runtime;
Runtime::LoaderSingleton::getExisting()->mergeValues(
{{"envoy.reloadable_features.fix_upgrade_response", "false"}});

// Test with the request headers not valid upgrade headers
{
TestRequestHeaderMapImpl request_headers{{"upgrade", "foo"}};
TestResponseHeaderMapImpl response_headers{{"connection", "upgrade"},
{"transfer-encoding", "eep"},
{"upgrade", "foo"},
{"custom_header", "custom_value"}};
EXPECT_FALSE(Utility::isUpgrade(request_headers));
EXPECT_TRUE(Utility::isUpgrade(response_headers));
ConnectionManagerUtility::mutateResponseHeaders(response_headers, &request_headers, config_,
"");

EXPECT_EQ(2UL, response_headers.size()) << response_headers;
EXPECT_EQ("custom_value", response_headers.get_("custom_header"));
EXPECT_EQ("foo", response_headers.get_("upgrade"));
}

// Test with the response headers not valid upgrade headers
{
TestRequestHeaderMapImpl request_headers{{"connection", "UpGrAdE"}, {"upgrade", "foo"}};
TestResponseHeaderMapImpl response_headers{{"transfer-encoding", "foo"}, {"upgrade", "bar"}};
EXPECT_TRUE(Utility::isUpgrade(request_headers));
EXPECT_FALSE(Utility::isUpgrade(response_headers));
ConnectionManagerUtility::mutateResponseHeaders(response_headers, &request_headers, config_,
"");

EXPECT_EQ(1UL, response_headers.size()) << response_headers;
EXPECT_EQ("bar", response_headers.get_("upgrade"));
}
}

// Test that we correctly return x-request-id if we were requested to force a trace.
TEST_F(ConnectionManagerUtilityTest, MutateResponseHeadersReturnXRequestId) {
TestResponseHeaderMapImpl response_headers;
Expand Down