Skip to content

Conversation

@kkk777-7
Copy link
Member

@kkk777-7 kkk777-7 commented Nov 3, 2025

What this PR does / why we need it:
Support PathSeparatedPrefix match in rate limit path match.

envoy ratelimit HeaderMatcher doesn't support PathSeparatedPrefix.
so use regex to achieve the same path-separated prefix behavior.

References

docs
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#config-route-v3-routematch

If specified, the route is a path-separated prefix rule meaning that the :path header (without the query string) must either exactly match the path_separated_prefix or have it as a prefix, followed by /

For example, /api/dev would match /api/dev, /api/dev/, /api/dev/v1, and /api/dev?param=true but would not match /api/developer

Expect the value to not contain ? or # and not to end in /

impl
https://github.com/envoyproxy/envoy/blob/main/source/common/router/config_impl.cc#L1476-L1491

Which issue(s) this PR fixes:

Fixes #7377

Release Notes: No

@kkk777-7 kkk777-7 requested a review from a team as a code owner November 3, 2025 07:07
@kkk777-7 kkk777-7 force-pushed the support-separated-path-match branch from 6e2a238 to f35d062 Compare November 3, 2025 07:15
@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.37%. Comparing base (3ac9120) to head (7ff71cb).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7413      +/-   ##
==========================================
+ Coverage   72.31%   72.37%   +0.05%     
==========================================
  Files         231      231              
  Lines       33970    33979       +9     
==========================================
+ Hits        24566    24592      +26     
+ Misses       7634     7619      -15     
+ Partials     1770     1768       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arkodg arkodg added this to the v1.6.0 Milestone milestone Nov 3, 2025
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team November 3, 2025 23:08
@zirain zirain enabled auto-merge (squash) November 4, 2025 01:31
@kkk777-7
Copy link
Member Author

kkk777-7 commented Nov 4, 2025

/retest

@arkodg arkodg disabled auto-merge November 4, 2025 03:10
@arkodg arkodg enabled auto-merge (squash) November 4, 2025 03:11
@arkodg arkodg disabled auto-merge November 4, 2025 03:11
@arkodg arkodg merged commit 313ac0a into envoyproxy:main Nov 4, 2025
51 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support PathSeparatedPrefix in rate limit path match

3 participants