Merge "Catch malformed URI exceptions when decoding cookies"

This commit is contained in:
jenkins-bot 2021-01-13 14:08:55 +00:00 committed by Gerrit Code Review
commit 5d77b295db

View file

@ -16,7 +16,13 @@
}
function decoded(s) {
return unRfc2068(decodeURIComponent(s.replace(pluses, ' ')));
try {
return unRfc2068(decodeURIComponent(s.replace(pluses, ' ')));
} catch(e) {
// If the cookie cannot be decoded this should not throw an error.
// See T271838.
return '';
}
}
function unRfc2068(value) {