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.
This commit is contained in:
Bobby Wibowo 2018-09-15 04:40:58 +07:00
parent 635027bde4
commit b47bbb90d6
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF

View File

@ -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.') }
}