diff --git a/changelogs/current.yaml b/changelogs/current.yaml index 6d938998b49f..49f3a8b719ce 100644 --- a/changelogs/current.yaml +++ b/changelogs/current.yaml @@ -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: diff --git a/source/common/router/config_utility.cc b/source/common/router/config_utility.cc index 7282c102875c..52820bc0c2fd 100644 --- a/source/common/router/config_utility.cc +++ b/source/common/router/config_utility.cc @@ -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(); } diff --git a/source/common/runtime/runtime_features.cc b/source/common/runtime/runtime_features.cc index 70249299a767..d5962e7f52eb 100644 --- a/source/common/runtime/runtime_features.cc +++ b/source/common/runtime/runtime_features.cc @@ -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); diff --git a/test/extensions/filters/http/router/config_test.cc b/test/extensions/filters/http/router/config_test.cc index fa84bd6d00d7..541380624507 100644 --- a/test/extensions/filters/http/router/config_test.cc +++ b/test/extensions/filters/http/router/config_test.cc @@ -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