fix(router): ensure that root URL redirect doesn't redirect non-root URLs
Closes #2221
This commit is contained in:
@ -57,8 +57,12 @@ export class RouteRecognizer {
|
||||
var solutions = ListWrapper.create();
|
||||
|
||||
MapWrapper.forEach(this.redirects, (target, path) => {
|
||||
// TODO: "/" redirect case
|
||||
if (StringWrapper.startsWith(url, path)) {
|
||||
// "/" redirect case
|
||||
if (path == '/' || path == '') {
|
||||
if (path == url) {
|
||||
url = target;
|
||||
}
|
||||
} else if (StringWrapper.startsWith(url, path)) {
|
||||
url = target + StringWrapper.substring(url, path.length);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user