mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 17:21:33 +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)
|
||||
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.') }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user