You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't catch the exception from ActivatedRoute.queryParams when using % in the URL - causes app to crash #21468
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ X ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Using ActivatedRoute.queryParams with url the includes % it throws an exception that can't be catched anywhere and causing the app to crash.
Expected behavior
To be able to catch this kind of error and to be able to keep working with the app
Minimal reproduction of the problem with instructions
Error found :
URIError: URI malformed
at decodeURIComponent ()
at Ye (vendor.6b9be0480d04ab9c9c6c.js:6)
at tn.$$parse (vendor.6b9be0480d04ab9c9c6c.js:6)
at tn.$$parseLinkUrl (vendor.6b9be0480d04ab9c9c6c.js:6)
at an.$get (vendor.6b9be0480d04ab9c9c6c.js:6)
at Object.a [as invoke] (vendor.6b9be0480d04ab9c9c6c.js:6)
at vendor.6b9be0480d04ab9c9c6c.js:6
at r (vendor.6b9be0480d04ab9c9c6c.js:6)
at i (vendor.6b9be0480d04ab9c9c6c.js:6)
at Object.a [as invoke] (vendor.6b9be0480d04ab9c9c6c.js:6)
What is the motivation / use case for changing the behavior?
By fixing this issue adding % in the URL will not crush the application
Environment
Angular version: 4.0.0
Browser:
- [ X ] Chrome (desktop) version 63.0.3239.132
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
Activity
sod commentedon Feb 8, 2018
Still an issue / angular 5.2.3.
In angular.js the router parses the uri component in a try/catch, thus ignoring invalid parts of the URL.
angular 5 doesn't try/catch. If decodeURIComponent throws (just like
decodeURIComponent('%')does), then the app stops functioning.skryvets commentedon Apr 7, 2018
I'm working on the solution and will submit the PR in near future.
fix(router): add ability to recover from malformed url
feynmanloo commentedon Jun 23, 2018
Still an issue / angular 6.0.0
fix(router): add ability to recover from malformed url (#23283)
docs: refactor pipe example to use the HttpClient (#22741)
muriloqr commentedon Apr 9, 2019
Still an issue for me, here is the workaround:
Add provider:
angular-automatic-lock-bot commentedon Sep 14, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.