Fix: Router ignored the root when creating hrefs#601
Fix: Router ignored the root when creating hrefs#601rluba wants to merge 3 commits intoaurelia:masterfrom
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-historyor the history will forward incorrect fragments to the router.