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

Fix greedy trailing * bug #7874

Merged
merged 2 commits into from
Aug 11, 2021
Merged

Fix greedy trailing * bug #7874

merged 2 commits into from
Aug 11, 2021

Conversation

brookslybrand
Copy link
Contributor

Fixes #7529

@brookslybrand
Copy link
Contributor Author

Didn't realize this fixed caused another bug 🤦‍♂️

Looking into it now to see if I can solve it

@@ -884,7 +884,7 @@ export function matchPath(
let matchedPathname = match[1];
let values = match.slice(2);
let params = paramNames.reduce((memo, paramName, index) => {
memo[paramName] = safelyDecodeURIComponent(values[index], paramName);
memo[paramName] = safelyDecodeURIComponent(values[index] || '', paramName);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mjackson Our updated regex below made it to where nothing matches for the final group in the case where the path is "react/*" and the pathname is "react". This meant we were getting undefined for that group's value, which cause the decoding to fail.

Everything is passing now with this simple fix, but let me know if this is a problem or if I should instead investigate fixing this at the expression building step inside of compilePath

@chaance chaance merged commit a0db8bf into remix-run:dev Aug 11, 2021
@brookslybrand brookslybrand deleted the dev branch August 13, 2021 21:34
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

2 participants