Bug 1678298 - [devtools] Use decodeURIComponent instead of decodeURI r=bomsy

Depends on D98294

Differential Revision: https://phabricator.services.mozilla.com/D98388
This commit is contained in:
Rahul Yedida 2021-01-06 09:13:08 +00:00
Родитель 5c7a830260
Коммит 398a8d1051
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -88,7 +88,13 @@ function getUnicodeUrl(url) {
return url;
}
const readableHostname = getUnicodeHostname(hostname);
url = decodeURI(url);
/* We use `decodeURIComponent` instead of decodeURI as the
* later does not decode some characters, it only can decode characters
* previously encoded by the encodeURI. See
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI#Description
*/
url = decodeURIComponent(url);
return url.replace(hostname, readableHostname);
} catch (err) {}
return url;