Skip to content

fix(router) anchor regex paths in traditional_compatible mode #9397

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

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

flrgh
Copy link
Contributor

@flrgh flrgh commented Sep 7, 2022

This is a cherry-pick of #9394.

The traditional router would use the `a` (anchor) flag when evaluating
input to ensure regex paths only match from the start of the string.

Given the route path `/prefix/[0-9]+`:

GET /prefix/123       => match
GET /extra/prefix/123 => no match

This updates the traditional_compatible router to replicate the same
behavior. The underlying atc router library does not support regex
flags, so we accomplish this by prepending the regex with `^`.
@flrgh flrgh added this to the 3.0 milestone Sep 7, 2022
@flrgh flrgh requested a review from a team as a code owner September 7, 2022 22:22
@aboudreault aboudreault merged commit f4a3072 into release/3.0.x Sep 7, 2022
@aboudreault aboudreault deleted the fix/router-trad-compat-regex-anchor branch September 7, 2022 23:18
chronolaw added a commit that referenced this pull request Sep 8, 2022
chronolaw added a commit that referenced this pull request Sep 21, 2022
chronolaw added a commit that referenced this pull request Sep 26, 2022
chronolaw added a commit that referenced this pull request Oct 6, 2022
chronolaw added a commit that referenced this pull request Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants