-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Bug]: Match route does not work if there is a minus sign at the beginning #8525
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
Comments
Update |
@mjackson Sorry to bother you. This bug is critical for us. We have already uploaded the new version of our application to production. Please pay attention to this problem. Probably there is an error somewhere in the regular expressions. Surely this can be fixed very quickly. |
remix-run/remix#819 relates here. We had to hack that patch in (probably breaking something else wrt routing) in order to get |
Update: This also breaks when there is a |
Same problem for @ character at the beginning |
In Remix, I can't use a splat path on any path with a hyphen anywhere in it. So, |
same here, urls with @ in the beginning does not work, this was working before, what happened ? thanks in advance |
Is there any advance on this, I can’t update my application becouse of this. |
I have problem with cyrillic symbols. The route beginning with the Cyrillic character is not found. Steps to Reproduce Actual Behavior /users/michael - This route is matched |
Try and analyze the regexes in play yourself - maybe you will be able to spot the error, file a PR, or - fork the repo and use it as a dependency directly: react-router/packages/react-router/index.tsx Lines 1188 to 1231 in a7a77da
|
This bug is what causes this: remix-run/remix#2012 |
I think the issue can be traced to line 1225: react-router/packages/react-router/index.tsx Lines 1213 to 1226 in 59b319f
The problem with using I'm not a regex expert and am not finding an equivalent of |
Fixed in #8563 |
@brophdawg11 the fix is #8563 doesn't appear to address the issue with routes that start with |
@troyschneringer it appears that of $ echo "@.-~" | node -e 'process.stdout.write(encodeURIComponent(require("fs").readFileSync(0, "utf-8")))'
%40.-~ The fix does support url-encoded characters, though I'm not sure how browsers handle |
@troyschneringer Yeah that's intentional per the
|
@brophdawg11 So are routes like https://www.npmjs.com/package/@types/node in violation of RFC 3986 and thus react-router won't support it, despite this existing in the wild? Or am I misunderstanding? |
I wouldn't consider it a hard "won't support it" based on #8563 alone - I would vote that support for Reserved Characters such as |
I think the operative phrase here is "... they may (or may not) be defined as delimiters by I believe standard URLs (via |
|
It would be great to support
|
What version of React Router are you using?
6.2.1
Steps to Reproduce
Expected Behavior
/users/-wYVsb1KDtT9YJJFUiSTq0dqUyvc5vK51nx7QW29CPJc
- This route is matchedActual Behavior
/users/-wYVsb1KDtT9YJJFUiSTq0dqUyvc5vK51nx7QW29CPJc
- This route is NOT matched/users/wYVsb1KDtT9YJJFUiSTq0dqUyvc5vK51nx7QW29CPJc
- This route is matchedI think the problem is in the mechanism that is looking for a suitable route.
Anything that starts with a symbol
-
is not matched.The text was updated successfully, but these errors were encountered: