From b47bbb90d6cd1101da5917984a8597bdccffff72 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Sat, 15 Sep 2018 04:40:58 +0700 Subject: [PATCH] Updated uploadController.js Fixed upload breaking when clam scanning is disabled. This was due to me forgetting to update the if-logic after switching from "clam-engine" to "clamdjs", since the latter made me have to re-format the config option due to it also having IP and port. --- controllers/uploadController.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/uploadController.js b/controllers/uploadController.js index e6fab27..78c748e 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -179,7 +179,7 @@ uploadsController.actuallyUpload = async (req, res, user, albumid) => { } }) - if (config.uploads.scan) { + if (config.uploads.scan && config.uploads.scan.enabled) { const scan = await uploadsController.scanFiles(req, infoMap) if (!scan) { return erred('Virus detected.') } } @@ -263,7 +263,7 @@ uploadsController.actuallyUploadByUrl = async (req, res, user, albumid) => { iteration++ if (iteration === urls.length) { - if (config.uploads.scan) { + if (config.uploads.scan && config.uploads.scan.enabled) { const scan = await uploadsController.scanFiles(req, infoMap) if (!scan) { return erred('Virus detected.') } } @@ -386,7 +386,7 @@ uploadsController.actuallyFinishChunks = async (req, res, user, albumid) => { iteration++ if (iteration === files.length) { - if (config.uploads.scan) { + if (config.uploads.scan && config.uploads.scan.enabled) { const scan = await uploadsController.scanFiles(req, infoMap) if (!scan) { return erred('Virus detected.') } }