handle malformed url [dynamic-json] (#1782)

This commit is contained in:
Danial
2018-07-17 12:50:36 +12:00
committed by GitHub
parent 3c594e8bcc
commit 6a1f0f60b1
2 changed files with 13 additions and 1 deletions

View File

@@ -7247,7 +7247,15 @@ cache({
sendBadge(format, badgeData);
return;
}
var url = encodeURI(decodeURIComponent(query.url || query.uri));
try {
var url = encodeURI(decodeURIComponent(query.url || query.uri));
} catch(e){
setBadgeColor(badgeData, 'red');
badgeData.text[1] = 'malformed url';
sendBadge(format, badgeData);
return;
}
switch (type) {
case 'json':