router5: trailingSlash: true does not work if there are query params
I’m having many issues with router5 when I use URLs with “query” parameters (not real URL query params, but those params after “?” after the URL fragment “#”).
My routes:
{
name : "foo",
path : "/:companyId"
}
Router options:
{
trailingSlash : true,
strictQueryParams : false
}
Then let’s open the web app directly with the following URLs:
https://localhost/#/microsoft
- It matches the
fooroute.
https://localhost/#/microsoft/
- It matches the
fooroute and rewrites the URL tohttps://localhost/#/microsoft.
https://localhost/#/microsoft?qwe=123
- It matches the
fooroute.
https://localhost/#/microsoft/?qwe=123
- It does NOT match the
fooroute.
I’ve also tried adding “/” to the path in the foo route and also trailingSlash:false. Nothing works.
Do I miss something? or is it just that router5 does not properly behave when there are “extra query params” in the initial URL?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 23 (7 by maintainers)
I hope this clearly shows the problem:
https://github.com/ibc/router5-url-issue