nolog ip ignoring empty lines in file, fixing checking

This commit is contained in:
MrFry 2020-01-09 15:26:11 +01:00
parent b7dc475cd4
commit 34cd2f25d6
3 changed files with 6 additions and 3 deletions

View file

@ -79,7 +79,7 @@ function LogReq (req, toFile, sc) {
let ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
let nolog = noLogips.some((x) => {
return x.includes(ip)
return ip.includes(x)
})
if (nolog) {
return
@ -118,6 +118,9 @@ function parseNoLogFile (newData) {
if (noLogips[noLogips.length - 1] === '') {
noLogips.pop()
}
noLogips = noLogips.filter((x) => {
return x !== ''
})
Log('\tNo Log IP-s changed: ' + noLogips.join(', '))
}