Skip to content
Open
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
3 changes: 3 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ removed_config_or_runtime:
- area: http
change: |
Removed runtime guard ``envoy.reloadable_features.http1_balsa_allow_cr_or_lf_at_request_start`` and legacy code paths.
- area: router
change: |
Removed runtime guard ``envoy.reloadable_features.enable_new_query_param_present_match_behavior`` and legacy code paths.

new_features:

Expand Down
6 changes: 2 additions & 4 deletions source/common/router/config_utility.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ bool ConfigUtility::QueryParameterMatcher::matches(
auto data = request_query_params.getFirstValue(name_);

// If we're doing a present_match, return whether the parameter exists and matches the expected
// presence
if (Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.enable_new_query_param_present_match_behavior") &&
present_match_.has_value()) {
// presence.
if (present_match_.has_value()) {
return data.has_value() == present_match_.value();
}

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 @@ -40,7 +40,6 @@ RUNTIME_GUARD(envoy_reloadable_features_dfp_cluster_resolves_hosts);
RUNTIME_GUARD(envoy_reloadable_features_disallow_quic_client_udp_mmsg);
RUNTIME_GUARD(envoy_reloadable_features_enable_cel_regex_precompilation);
RUNTIME_GUARD(envoy_reloadable_features_enable_compression_bomb_protection);
RUNTIME_GUARD(envoy_reloadable_features_enable_new_query_param_present_match_behavior);
RUNTIME_GUARD(envoy_reloadable_features_ext_proc_fail_close_spurious_resp);
RUNTIME_GUARD(envoy_reloadable_features_generic_proxy_codec_buffer_limit);
RUNTIME_GUARD(envoy_reloadable_features_grpc_side_stream_flow_control);
Expand Down
90 changes: 0 additions & 90 deletions test/extensions/filters/http/router/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,96 +140,6 @@ name: debug
EXPECT_FALSE(matcher.matches(second_match_params));
}

TEST_F(QueryParameterMatcherTest, PresentMatchTrueWithFeatureEnabled) {
TestScopedRuntime scoped_runtime;
scoped_runtime.mergeValues(
{{"envoy.reloadable_features.enable_new_query_param_present_match_behavior", "true"}});

const std::string yaml = R"EOF(
name: debug
present_match: true
)EOF";

auto matcher = createQueryParamMatcher(yaml);

auto params = Http::Utility::QueryParamsMulti::parseQueryString("?debug=1");
EXPECT_TRUE(matcher.matches(params));

auto empty_value_params = Http::Utility::QueryParamsMulti::parseQueryString("?debug=");
EXPECT_TRUE(matcher.matches(empty_value_params));

auto no_match_params = Http::Utility::QueryParamsMulti::parseQueryString("?other=1");
EXPECT_FALSE(matcher.matches(no_match_params));
}

TEST_F(QueryParameterMatcherTest, PresentMatchTrueWithFeatureDisabled) {
TestScopedRuntime scoped_runtime;
scoped_runtime.mergeValues(
{{"envoy.reloadable_features.enable_new_query_param_present_match_behavior", "false"}});

const std::string yaml = R"EOF(
name: debug
present_match: true
)EOF";

auto matcher = createQueryParamMatcher(yaml);

// When feature is disabled, falls back to normal present check behavior
auto params = Http::Utility::QueryParamsMulti::parseQueryString("?debug=1");
EXPECT_TRUE(matcher.matches(params)); // Param exists, no string matcher -> true

auto empty_value_params = Http::Utility::QueryParamsMulti::parseQueryString("?debug=");
EXPECT_TRUE(matcher.matches(empty_value_params)); // Param exists, no string matcher -> true

auto no_match_params = Http::Utility::QueryParamsMulti::parseQueryString("?other=1");
EXPECT_FALSE(matcher.matches(no_match_params)); // Param doesn't exist -> false
}

TEST_F(QueryParameterMatcherTest, PresentMatchFalseWithFeatureEnabled) {
TestScopedRuntime scoped_runtime;
scoped_runtime.mergeValues(
{{"envoy.reloadable_features.enable_new_query_param_present_match_behavior", "true"}});

const std::string yaml = R"EOF(
name: debug
present_match: false
)EOF";

auto matcher = createQueryParamMatcher(yaml);

auto params = Http::Utility::QueryParamsMulti::parseQueryString("?debug=1");
EXPECT_FALSE(matcher.matches(params));

auto empty_value_params = Http::Utility::QueryParamsMulti::parseQueryString("?debug=");
EXPECT_FALSE(matcher.matches(empty_value_params));

auto no_match_params = Http::Utility::QueryParamsMulti::parseQueryString("?other=1");
EXPECT_TRUE(matcher.matches(no_match_params));
}

TEST_F(QueryParameterMatcherTest, PresentMatchFalseWithFeatureDisabled) {
TestScopedRuntime scoped_runtime;
scoped_runtime.mergeValues(
{{"envoy.reloadable_features.enable_new_query_param_present_match_behavior", "false"}});

const std::string yaml = R"EOF(
name: debug
present_match: false
)EOF";

auto matcher = createQueryParamMatcher(yaml);

// When feature is disabled, falls back to normal present check behavior
auto params = Http::Utility::QueryParamsMulti::parseQueryString("?debug=1");
EXPECT_TRUE(matcher.matches(params)); // Param exists, no string matcher -> true

auto empty_value_params = Http::Utility::QueryParamsMulti::parseQueryString("?debug=");
EXPECT_TRUE(matcher.matches(empty_value_params)); // Param exists, no string matcher -> true

auto no_match_params = Http::Utility::QueryParamsMulti::parseQueryString("?other=1");
EXPECT_FALSE(matcher.matches(no_match_params)); // Param doesn't exist -> false
}

TEST(RouterFilterConfigTest, SimpleRouterFilterConfig) {
const std::string yaml_string = R"EOF(
dynamic_stats: true
Expand Down
Loading