Use absUrl, so WEBROOT isn't ignored on redirect
For the 'fall-through' condition for Angular routing, it will simply redirect to the URL wanted. Basically, Angular says: "If I don't know this URL in my internal routing, it's outside the single-page-app and needs to be pulled from the server." However, the code uses the general Angular path, which does NOT include the base tag's prefix, meaning in a situation where WEBROOT is set to other than '/' it will not include the base value, and route to a non-WEBROOTed path. Using absUrl correctly uses the full path. Change-Id: Idbf91bd5913937788bf31bcf1d389c590dd3e2d7 Closes-Bug: 1597823
This commit is contained in:
parent
c6f3f6f332
commit
eb60a8b287
@ -44,7 +44,7 @@
|
||||
waitSpinnerService
|
||||
) {
|
||||
waitSpinnerService.showModalSpinner(gettext('Loading'));
|
||||
$window.location.href = $location.path();
|
||||
$window.location.href = $location.absUrl();
|
||||
}
|
||||
|
||||
}());
|
||||
|
@ -32,7 +32,8 @@
|
||||
controller = $injector.get('$controller');
|
||||
waitSpinnerService = $injector.get('horizon.framework.widgets.modal-wait-spinner.service');
|
||||
|
||||
spyOn($location, 'path').and.returnValue('path');
|
||||
// NOTE: This is using absUrl, so requests will already include WEBROOT.
|
||||
spyOn($location, 'absUrl').and.returnValue('path');
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user