-
-
Notifications
You must be signed in to change notification settings - Fork 115
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: Router ignored the root when creating hrefs #601
base: master
Are you sure you want to change the base?
Conversation
This caused all non-default click actions (eg. CMD+Click, Right-click-> "Open in new Tab/Browser", etc.) to navigate to the wrong URL
Don’t merge this PR yet. |
I discovered that redirects via route configurations, eg., There are multiple issues:
Are these issues already known? |
…because they’re generated when the router does not yet know its `baseUrl`. We therefore need to infer it from the navigation instruction.
The test coverage for this module is pretty horrible. I’ll help bring it up in the future if we decide to stick with Aurelia. |
That is a generous assessment lol. Part of the reason Router dev has been slow recently is I find myself spending more time fixing the tests than getting to actual issues, and its very time consuming. Thanks for your hard work. These are on my radar. |
Can someone please update this PR and merge it finally? This requirement is still unsatisfied. |
#632 has been merged a while ago. |
Aurelia router generated absolute paths but did not append the root path (ie.
<base href="…">
). This is incorrect and caused all non-default click actions (eg. CMD+Click, Right-click-> "Open in new Tab/Browser", etc.) to navigate to the wrong URL (see issue #457) and also broke links for crawlers.Normal clicks only worked because they are intercepted by Aurelia and forwarded to
aurelia-browser-history
, which contains a corresponding bug that treats all URLs as fragments instead of expecting the base path to be present in absolute paths.This fix requires the corresponding fix for
aurelia-browser-history
or the history will forward incorrect fragments to the router.