diff --git a/includes/downloads.js b/includes/downloads.js index e57b623..6298444 100644 --- a/includes/downloads.js +++ b/includes/downloads.js @@ -21,29 +21,26 @@ module.exports= */ main: function(res, requestURL) { - return new Promise(function(resolve, reject) + const urlSplit = requestURL.split("/"); + if(urlSplit.length == 2 || urlSplit.length == 4) { - const urlSplit = requestURL.split("/"); - if(urlSplit.length == 2 || urlSplit.length == 4) + sql.getDownload(urlSplit[1]).then(function(result) { - sql.getDownload(urlSplit[1]).then(function(result) + if(result.length == 1) { - if(result.length == 1) - { - const file = './blogContent/downloads/' + - result[0].file; - res.download(file); - } - else - { - pageBuilder.print404(res); - } - }); - } - else - { - pageBuilder.print404(res); - } - }); + const file = './blogContent/downloads/' + + result[0].file; + res.download(file); + } + else + { + pageBuilder.print404(res); + } + }); + } + else + { + pageBuilder.print404(res); + } } }; \ No newline at end of file diff --git a/includes/html/footer.html b/includes/html/footer.html index 89e4667..22c86fe 100644 --- a/includes/html/footer.html +++ b/includes/html/footer.html @@ -1,7 +1,3 @@ - - - -