Replies: 2 comments
-
|
No, the router uses regular expressions internally so it is impossible to protect from conflicting routes. Trying to make warnings for some cases would be pointless, since there is way too many. It is something users just need to be aware of. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Regexes, right. Yep... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
(skip to TL;DR if ... you know)
I've manually removed date stamps from logs, trimmed outputs in some places and run everything under
carton v1.0.21but falsified it to look like everything is installed globally.Long winding path, that eventually gets to the point
In direct defiance of
Mojolicious::Guides::GrowingI like to split a growing::Liteapp up into severalMyApp::Lite::SpecificThingpackages full of further::Liteapps and then duct tape them back together withMojolicious::Plugin::Mojolyst.Today I managed to mis-edit one of my
::SpecificThing's and ended up with aget "/" => sub ...in two places, whichMojolystcheerfully merged intoMyApp's routes.myapp routesshowed me bothget /s in the list - one of them was bogus, and lead tocan't render a responsewhich I've since fixed, but while trying to get my head around it I wrote a repro case that I thought should explode:badapp:but it didn't explode, Mojo seems totally Ok with just ... having two routes with the same verb+path:
Not a care in the world about it, not even a warning:
TL;DR
... as we can see
Mojolicious::Routerallows you to have two routes with the same verb/pathIf it's Ok for there to be two
get /s, shouldMojolicious::Command::routesshow the file/package/line where each was declared (which involves somecallertracking::Routes)If it's not Ok, should
::Routesproduce a (possibly%ENV-guarded) error/warning about it?Beta Was this translation helpful? Give feedback.
All reactions