http-rs / http-rs/tide

Nail down wildcard/fallback rules

Open
#12 9 comments 1 reaction 2 assignees Claimed by @tirr-c View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.