mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-19 01:31:34 +00:00
fix: passthrough scan
This commit is contained in:
parent
dd6f225461
commit
b5aa8d0758
@ -627,8 +627,10 @@ self.assertPassthroughScans = async (req, user, infoMap) => {
|
||||
for (const info of infoMap) {
|
||||
if (info.data.clamscan) {
|
||||
if (info.data.clamscan.isInfected) {
|
||||
logger.log(`[ClamAV]: ${info.data.filename}: ${info.data.clamscan.viruses.join(', ')}`)
|
||||
foundThreats.push(...info.data.clamscan.viruses)
|
||||
} else if (info.data.clamscan.isInfected === null) {
|
||||
logger.log(`[ClamAV]: ${info.data.filename}: Unable to scan`)
|
||||
unableToScan.push(info.data.filename)
|
||||
}
|
||||
} else {
|
||||
|
@ -26,7 +26,7 @@ DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) {
|
||||
let tempError = null
|
||||
let tempObject = {}
|
||||
let tempWeight = 0
|
||||
const _cb = (err = null, result = {}, weight = 1) => {
|
||||
const _cb = (err = null, result = {}, weight = 2) => {
|
||||
tempError = err
|
||||
tempWeight += weight
|
||||
tempObject = Object.assign(result, tempObject)
|
||||
@ -75,7 +75,7 @@ DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) {
|
||||
destination,
|
||||
filename,
|
||||
path: finalPath
|
||||
}, 2)
|
||||
})
|
||||
})
|
||||
file.stream.pipe(outStream, { end: false })
|
||||
} else {
|
||||
@ -95,7 +95,7 @@ DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) {
|
||||
clamStream.on('scan-complete', result => {
|
||||
_cb(null, {
|
||||
clamscan: result
|
||||
})
|
||||
}, 1)
|
||||
})
|
||||
file.stream.pipe(clamStream).pipe(outStream)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user