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

Regex fix to avoid matching a trailing slash. #1677

Merged
merged 2 commits into from Mar 26, 2014

Conversation

ericsoco
Copy link

@ericsoco ericsoco commented Mar 4, 2014

The default regex '([^/#?]*)' inserted as a placeholder for matching named patterns matches empty components, such as a trailing slash. This means that a pattern such as /foo/:bar/:baz will match /foo/BAR/, while it should only match foo/BAR/BAZ.

Changing the regex to '([^/#?]+)' to require at least one character in the component keeps trailing slashes from matching the specified path.

@ericf
Copy link
Member

ericf commented Mar 4, 2014

Can you add some tests for this? Thanks!

@saw
Copy link
Contributor

saw commented Mar 4, 2014

(this is to fix a regression we found after upgrading)

@ezequiel ezequiel merged commit 40f7c02 into yui:dev-master Mar 26, 2014
@ezequiel
Copy link
Contributor

Thanks.

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

Successfully merging this pull request may close these issues.

None yet

4 participants