[英]Got Error: Cannot match any routes. URL Segment:
Angular App throwing Cannot match any routes error with XSS script in URL: Angular App throwing Cannot match any routes error with XSS script in URL:
I am developing an application in Angular 4. When I am trying to write routes for a feature module, I am getting an error as Error: Cannot match any routes.我正在 Angular 4 中开发应用程序。当我尝试为功能模块编写路由时,我收到错误消息:无法匹配任何路由。
Here's the routes code I have used:这是我使用的路线代码:
const ROUTES: Routes = [
{path: '', redirectTo: '/', pathMatch: 'full'},
{path: 'test/:name', component: TestCompnent},
{path: '**', component: TestCompnent}
];
Routing is working fine and going to the TestCompnent when the route is something like test/angular or test/some-course-name but when I try to inject some XSS script into the same route, such as当路由类似于 test/angular 或 test/some-course-name 但当我尝试将一些 XSS 脚本注入同一路由时,路由工作正常并转到 TestCompnent,例如
test/<script>alert('hello')</script>,
its throwing an error as它抛出一个错误
Error: Cannot match any routes.错误:无法匹配任何路由。 URL Segment: ''hello'' Error: Cannot match any routes.
URL 段:“你好”错误:无法匹配任何路由。 URL Segment: ''hello''
URL 段:“你好”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.