Fixed critical bug that made the site unreachable if an incorrect request to /status/ was made

This commit is contained in:
supositware 2021-05-20 00:02:46 +02:00
parent c1e69ac51f
commit 97158b2ecf
2 changed files with 3 additions and 0 deletions

View file

@ -81,6 +81,8 @@ router.get('/status/:uuid', function (req, res ,next) {
let uuid = req.params.uuid;
if (progress[uuid]) {
res.send(progress[uuid]);
} else {
res.send(undefined);
}
});

View file

@ -267,6 +267,7 @@ Come take a look here https://git.namejeff.xyz/Supositware/jeff-downloader for a
xhttp.send();
xhttp.addEventListener("load", function(event) {
console.log(event.target.responseText);
if (event.target.responseText === '') return;
document.getElementsByTagName("progress")[0].value = event.target.responseText;
document.getElementsByTagName("progress")[0].innerHTML = `${event.target.responseText}%`;
});