-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Panic on overlapping routes in MethodRouter
#1102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about get(foo).head(bar)
? We probably want that to work, no?
It does work already but I added tests just to make sure. It works because we only override the corresponding service so doing |
* Panic on overlapping routes in `MethodRouter` * changelog link * add test to ensure `head` and `get` don't overlap
* Panic on overlapping routes in `MethodRouter` * changelog link * add test to ensure `head` and `get` don't overlap
* Panic on overlapping routes in `MethodRouter` * changelog link * add test to ensure `head` and `get` don't overlap
* Panic on overlapping routes in `MethodRouter` * changelog link * add test to ensure `head` and `get` don't overlap
* Panic on overlapping routes in `MethodRouter` * changelog link * add test to ensure `head` and `get` don't overlap
* Prepare axum-next branch * Remove deprecated `extractor_middleware` function (#1077) * Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#948) * Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` (#924) * Allow `Error: Into<Infallible>` for `Route::{layer, route_layer}` Fixes #922 * changelog * fixup changelog * Panic on overlapping routes in `MethodRouter` (#1102) * Panic on overlapping routes in `MethodRouter` * changelog link * add test to ensure `head` and `get` don't overlap * Fix changelog * Prepare axum-next branch * Remove trailing slash redirects * changelog link * Fix changelog * remove asserting to make make the test more clear * remove tsr related feature * Add `RouterExt::route_with_tsr` * Apply suggestions from code review Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * Update axum-extra/src/routing/mod.rs Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * fix typos in docs * Update axum/CHANGELOG.md Co-authored-by: Jonas Platte <jplatte+git@posteo.de> * mention `RouterExt::route_with_tsr` in the changelog Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
Makes
get(foo).get(bar)
panic, similarly toRouter::route
.Fixes #1097