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

Properly continue match after pathless routes #3308

Merged
merged 1 commit into from
Apr 14, 2016

Conversation

taion
Copy link
Contributor

@taion taion commented Apr 14, 2016

Fixes #3307

@taion taion force-pushed the match-after-pathless branch from 66c3248 to f2e32fe Compare April 14, 2016 07:02
@taion taion force-pushed the match-after-pathless branch from f2e32fe to 3fd04bd Compare April 14, 2016 07:04
@taion
Copy link
Contributor Author

taion commented Apr 14, 2016

I think this issue only comes up with a splat nested under pathless routes.

This is a simplified version of a fix from #3246.

@taion
Copy link
Contributor Author

taion commented Apr 14, 2016

Just to explain what's happening with these in a bit more detail – to actually avoid matching extraneous slashes per #3158, we need to be careful about whether the slash ends up in the "remaining pathname" after a match, or if it ends up consumed by the match pattern itself.

Normally this isn't a problem, but there's an edge case with pathless routes when the pathname is /, such that the pathless routes will incorrectly "consume" the slash.

The more complicated fix in #3246 "restores" the slash, but it's easier (and cheaper) to just not run the match in the first place, since we know it's not going to accomplish anything.

@taion
Copy link
Contributor Author

taion commented Apr 14, 2016

Could I get a review here? I'd like to cut a release to address @MoOx's issue.

@timdorr timdorr merged commit 6df5320 into remix-run:master Apr 14, 2016
@taion taion deleted the match-after-pathless branch April 14, 2016 16:12
@taion
Copy link
Contributor Author

taion commented Apr 14, 2016

Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants