jetersen/express-ipfilter

I see 5 entries in the log for each IP blocking

Opened this issue · 1 comments

When the module blocks an IP it shows in the log 5 lines of the same message:

www > Access denied to IP address: 2a02:2f0f:*************
www > Access denied to IP address: 2a02:2f0f:*************
www > Access denied to IP address: 2a02:2f0f:*************
www > Access denied to IP address: 2a02:2f0f:*************
www > Access denied to IP address: 2a02:2f0f:*************

Any idea why this is happening?

Thank you!

This is my code

let clientIp = function(req, res) {
    return req.headers['x-forwarded-for'] ? (req.headers['x-forwarded-for']).split(',')[0] : ""
}

var app = express();
app.use(
  helmet({
    contentSecurityPolicy: false,
  })
);

app.use(ipfilter(ips, { mode: 'deny', logLevel: 'deny', detectIp: clientIp }))