axum: Update matchit to 0.8.6 and support capture prefixes and suffixes#3679
Open
axum: Update matchit to 0.8.6 and support capture prefixes and suffixes#3679
Conversation
ADD-SP
commented
Mar 5, 2026
| @@ -0,0 +1,4 @@ | |||
| [default] | |||
| extend-ignore-re = [ | |||
| "`([^`]+)`", | |||
Member
Author
Contributor
There was a problem hiding this comment.
I think this is much too broad of an exclusion. Just update the docs sample to something else?
Member
Author
There was a problem hiding this comment.
Content wrapped in backticks usually consists of proper nouns and inline code, so I think it’s reasonable to exclude this pattern.
mladedav
requested changes
Mar 5, 2026
Comment on lines
+48
to
+61
| You may mix captures that have different static prefixes or suffixes, though it is discouraged as it | ||
| might lead to surprising behavior. If multiple routes would match, the one with the longest static | ||
| prefix is used, if there are multiple with the same match, the longest matched static suffix is | ||
| chosen. For example, if a request is done to `/abcdef` here are examples of routes that would all | ||
| match. If multiple of these were defined in a single router, the topmost one would be used. | ||
|
|
||
| - `/abcdef` | ||
| - `/abc{x}ef` | ||
| - `/abc{x}f` | ||
| - `/abc{x}` | ||
| - `/a{x}def` | ||
| - `/a{x}` | ||
| - `/{x}def` | ||
| - `/{x}` |
Collaborator
There was a problem hiding this comment.
This is the reason we didn't merge the 0.8.6 update. The logic is simply too surprising.
If you want to push this forward, can you please update matchit to 0.9 and change the documentation (and possibly the new tests) to align with that version? That version disallows these semi-conflicting routes in a single router.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Copy-pasting from #3143 to move forward this work.