-
Notifications
You must be signed in to change notification settings - Fork 140
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
Bug: Broken routing for aliased routes ending with <...>/::something
& <...>/:some_var
#241
Comments
You can't have ambiguous behavior. If I'm not sure if we support it, but having |
I don't see the ambiguity here. According to the readme of this project, Quoted from the readme:
The only ambiguity is between Come think of it, using |
The invite stands: would you like to send a PR? |
I can maybe look into it in a few days, but can't be sure I'll be able to, as my schedule is currently very busy. |
Versions tested:
"find-my-way": "^4.5.0"
)Both contain the bug, but the symptoms are different. The bug is more severe in 5.2.0.
TL;DR: There appears to be a bug for pairs of routes, one ending with
/::something
and the other with/:some_var
. The exact behavior depends on thefind-my-way
version (see "Observed behavior" below), but is incorrect in either case. See "Failure MCVE" below.Prefixes other than
::
seem to work correctly (tested:~
,@
,$
). See "Working MCVE" below.Failure MCVE: (
index.mjs
)Observed behavior v4.5.1:
GET /myworld/:articles
request matches the second (/:world_name/:article_name
) route (see below).Observed behavior v5.2.0: Both
GET /myworld/:articles
andGET /myworld/somearticle
result in a 404 Not Found error. In other words, neither route works, as if they did not exist.Expected behavior: The above request should match the first (
/:world_name/::articles
) route. Additionally (v5.2.0): The second route should still work as normal for/myworld/somearticle
.Partial workaround: No known workaround on my part for the exact same route, but changing
::articles
to a different prefix symbol (e.g.~articles
) works in both 4.5.1 and 5.2.0.GET /myworld/:articles
:Success MCVE: (modified failure example, by changing
::articles
to~articles
in the route)… (correctly) results in the following being matched for a
GET /myworld/~articles
:The text was updated successfully, but these errors were encountered: