Commit 295142e
committed
fix(ngRoute): wrong redirect to path containing named groups ending with star or question mark
When the path contains optional parameters or special parameters the redirects to those routes are broken, the location will end with the relative encoded character.
To reproduce the issue:
* create a route with optional parameters, es. `$routeProvider.when('/profile/:userId?', ...)`
* angular will add the automatic redirect with or without the trailing **/**, in this case `'/profile/:userId?/'`
* point the browser to the redirect `http://localhost/#!/profile/0/`, you'll see the encoded `? (%3F)` at the end of the url: `http://localhost/#!/profile/0%3F`
Happens also for the special parameters `*` and also for the opposite scenario, when the route has `/profile/:userId?/` and you browse the url `/profile/0`. It affects every redirect that uses the function interpolate.1 parent affcbad commit 295142e
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
590 | 590 | | |
591 | 591 | | |
592 | | - | |
| 592 | + | |
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| |||
0 commit comments