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(ipfilter(ips, { 'mode': 'allow' }));
|
||||||
|
|
||||||
app.use((err, req, res, _next) => {
|
app.use((err, req, res, _next) => {
|
||||||
console.log('Error handler', err);
|
const thisErr = Object.assign({},err);
|
||||||
if(err instanceof IpDeniedError)
|
thisErr.originalUrl = req.originalUrl;
|
||||||
|
|
||||||
|
console.log('Error handler', thisErr);
|
||||||
|
console.log(req);
|
||||||
|
if(thisErr instanceof IpDeniedError)
|
||||||
res.status(401);
|
res.status(401);
|
||||||
|
|
||||||
else
|
else
|
||||||
res.status(err.status || 500);
|
res.status(thisErr.status || 500);
|
||||||
|
|
||||||
/* res.render('error', {
|
/* res.render('error', {
|
||||||
'message': 'You shall not pass',
|
'message': 'You shall not pass',
|
||||||
|
Loading…
Reference in New Issue
Block a user