log blocked ip addresses request url
This commit is contained in:
parent
623e42e6d7
commit
8745bf887f
10
server.js
10
server.js
@ -35,12 +35,16 @@ const complexUrls = new Map();
|
||||
app.use(ipfilter(ips, { 'mode': 'allow' }));
|
||||
|
||||
app.use((err, req, res, _next) => {
|
||||
console.log('Error handler', err);
|
||||
if(err instanceof IpDeniedError)
|
||||
const thisErr = Object.assign({},err);
|
||||
thisErr.originalUrl = req.originalUrl;
|
||||
|
||||
console.log('Error handler', thisErr);
|
||||
console.log(req);
|
||||
if(thisErr instanceof IpDeniedError)
|
||||
res.status(401);
|
||||
|
||||
else
|
||||
res.status(err.status || 500);
|
||||
res.status(thisErr.status || 500);
|
||||
|
||||
/* res.render('error', {
|
||||
'message': 'You shall not pass',
|
||||
|
Loading…
Reference in New Issue
Block a user