diff --git a/server.js b/server.js index 8bf1c55..60a09c5 100644 --- a/server.js +++ b/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',