Merge pull request #4238 from thornbill/fix-router-xss
Fix XSS vulnerability in router
This commit is contained in:
@@ -59,8 +59,6 @@ class AppRouter {
|
||||
this.baseRoute = this.baseRoute.substring(0, this.baseRoute.length - 1);
|
||||
}
|
||||
|
||||
this.setBaseRoute();
|
||||
|
||||
// paths that start with a hashbang (i.e. /#!/page.html) get transformed to starting with //
|
||||
// we need to strip one "/" for our routes to work
|
||||
page('//*', (ctx) => {
|
||||
@@ -68,18 +66,6 @@ class AppRouter {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
setBaseRoute() {
|
||||
let baseRoute = window.location.pathname.replace(this.getRequestFile(), '');
|
||||
if (baseRoute.lastIndexOf('/') === baseRoute.length - 1) {
|
||||
baseRoute = baseRoute.substring(0, baseRoute.length - 1);
|
||||
}
|
||||
console.debug('setting page base to ' + baseRoute);
|
||||
page.base(baseRoute);
|
||||
}
|
||||
|
||||
addRoute(path, newRoute) {
|
||||
page(path, this.getHandler(newRoute));
|
||||
this.allRoutes.push(newRoute);
|
||||
|
||||
Reference in New Issue
Block a user