-
Notifications
You must be signed in to change notification settings - Fork 27.3k
decodeURIComponent - prevent URIError #13993
Conversation
Replace decodeURIComponent with tryDecodeURIComponent to prevent throwing "URIError: malformed URI sequence". https://github.com/angular/angular.js/blob/master/src/Angular.js#L1275
googlebot
commented
Feb 10, 2016
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
📝 Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
- If you signed the CLA as a corporation, please let us know the company's name.
1 similar comment
googlebot
commented
Feb 10, 2016
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
📝 Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
- If you signed the CLA as a corporation, please let us know the company's name.
modmac
commented
Feb 10, 2016
I signed it!
2016年02月10日 15:34 GMT+01:00 googlebot notifications@github.com:
Thanks for your pull request. It looks like this may be your first
contribution to a Google open source project. Before we can look at your
pull request, you'll need to sign a Contributor License Agreement (CLA).[image: 📝] Please visit https://cla.developers.google.com/
https://cla.developers.google.com/ to sign.Once you've signed, please reply here (e.g. I signed it!) and we'll
verify. Thanks.
- If you've already signed a CLA, it's possible we don't have your
GitHub username or you're using a different email address. Check your
existing CLA data https://cla.developers.google.com/clas and verify
that your email is set on your git commits
https://help.github.com/articles/setting-your-email-in-git/.- If you signed the CLA as a corporation, please let us know the
company's name.—
Reply to this email directly or view it on GitHub
#13993 (comment).
googlebot
commented
Feb 10, 2016
CLAs look good, thanks!
1 similar comment
googlebot
commented
Feb 10, 2016
CLAs look good, thanks!
gkalpak
commented
Feb 10, 2016
I think this will break the contract that $location.path() or $location.hash() return a string.
OOC, under what circumstances can this error been thrown ? Do you have a reproduction.
There should also be some tests, verifying the new behavior and guarding against regressions.
modmac
commented
Feb 11, 2016
Yes, try to request a page with a #% hash in the URL.
Example:
https://console.developers.google.com/freetrial?newProject=false#%
Maybe in this example, if decodeURIComponent throws an error, we should catch it and encode hash/uri to keep wrong characters (ex. single %) as encoded UTF?
gkalpak
commented
Feb 11, 2016
Aha, I see the error.
TBH, trying to guess and fix unencoded UTF characters is a business I'd rather not be into :)
That said, silently failing on invalid URLs, won't be fun to debug. I think it's better to throw here.
@petebacondarwin, wdyt ?
Replace decodeURIComponent with tryDecodeURIComponent to prevent throwing "URIError: malformed URI sequence".
https://github.com/angular/angular.js/blob/master/src/Angular.js#L1275