urlrouter
urlrouter copied to clipboard
old router vs new router
In the olden days I could use a route such as
/files/:id/:filename? and that would match paths like
-
/files/1234 -
/files/1234/big -
/files/1234/big.png -
/files/1234/big-bird -
/files/1234/big-bird.png
I just converted an old-old-old app over and this new urlrouter handles that for paths like
-
/files/1234 -
/files/1234/big -
/files/1234-678/big
But not
-
/files/1234-678/big.png -
/files/1234-678/big-bird -
/files/1234-678/big-bird.png
Is that a bug? It seems like it since :id is matching as expected, so why is :filename matching differently, y'know?
If not, is there an equivalent?
As a quick and simple fix I expanded to matching
-
/files/:id/:filename -
/files/:id
and that seems to work as expected
Anyway, just wanted to know if "that's how we roll" these days or if it's a bug.