mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-19 01:31:34 +00:00
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:
parent
635027bde4
commit
b47bbb90d6
@ -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)
|
const scan = await uploadsController.scanFiles(req, infoMap)
|
||||||
if (!scan) { return erred('Virus detected.') }
|
if (!scan) { return erred('Virus detected.') }
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ uploadsController.actuallyUploadByUrl = async (req, res, user, albumid) => {
|
|||||||
|
|
||||||
iteration++
|
iteration++
|
||||||
if (iteration === urls.length) {
|
if (iteration === urls.length) {
|
||||||
if (config.uploads.scan) {
|
if (config.uploads.scan && config.uploads.scan.enabled) {
|
||||||
const scan = await uploadsController.scanFiles(req, infoMap)
|
const scan = await uploadsController.scanFiles(req, infoMap)
|
||||||
if (!scan) { return erred('Virus detected.') }
|
if (!scan) { return erred('Virus detected.') }
|
||||||
}
|
}
|
||||||
@ -386,7 +386,7 @@ uploadsController.actuallyFinishChunks = async (req, res, user, albumid) => {
|
|||||||
|
|
||||||
iteration++
|
iteration++
|
||||||
if (iteration === files.length) {
|
if (iteration === files.length) {
|
||||||
if (config.uploads.scan) {
|
if (config.uploads.scan && config.uploads.scan.enabled) {
|
||||||
const scan = await uploadsController.scanFiles(req, infoMap)
|
const scan = await uploadsController.scanFiles(req, infoMap)
|
||||||
if (!scan) { return erred('Virus detected.') }
|
if (!scan) { return erred('Virus detected.') }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user