Skip to content
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

Routing is too greedy #128

Closed
jpeltoniemi opened this issue May 16, 2017 · 3 comments
Closed

Routing is too greedy #128

jpeltoniemi opened this issue May 16, 2017 · 3 comments

Comments

@jpeltoniemi
Copy link

Consider route /:moduleName/

I'd expect it to match only one-part urls like /users/ or /things/ but instead it matches every url with at least one level.

So, with that route this url /rock/paper/scissors/ gives me {moduleName: 'scissors'} while the expected result is to not match at all.

As /:moduleName/:pageName with the url /rock/paper/scissors gets parsed to {moduleName: 'paper', pageName: 'scissors'}, I'd say it doesn't care where the route matches the url.

@krasimir
Copy link
Owner

This issue made me rethink how Navigo handles routes. The route matching is based on regular expressions and one of them was not quite ok. That's now fixed as part of this latest release. However, these updates change how Navigo uses the registered routes so it may be a breaking change. I bumped the major version. So @jpeltoniemi can you please try with the latest 5.0.0.

@jpeltoniemi
Copy link
Author

Sorry, I was in a hurry and couldn't wait, so I improvised my own router and as it seems to do its job pretty well, I can't really afford to spend time on Navigo anymore :/

@krasimir
Copy link
Owner

Fair enough 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants