Nail down wildcard/fallback rules
Open
blocked
- Dominant language
- Rust
- Stars
- 5.1k
- Forks
- 329
- PR merge metrics
- No merged PRs in 30d
Description
The initial implementation of the router uses *greedy* matching for URL segments. Imagine you have two routes:
- `foo/{}/baz`
- `foo/new/bar`
The URL `foo/new/baz` will *fail to be routed*, because the `new` component will be greedily matched (concrete segments are always preferred over wildcards) and there is no backtracking.
This behavior is the simplest to implement, but it's not clear that it's the most *obvious* behavior. OTOH, it's not clear that the URL *should* match here. And in general, this kind of routing situation seems like an anti-pattern, and is perhaps something we should detect and disallow.
Thoughts welcome!
Contributor guide
Assessment
This issue has not been assessed yet.