Add support for cloudflare connecting ip

This commit is contained in:
Rishi Panthee 2022-09-06 10:47:17 -04:00
parent 221b277f2e
commit d07570e4d9
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ let server = null;
let database = null;
const requestLogger = function (req, _, next) {
console.log(`Incoming request from ${req.headers['x-forwarded-for'] || req.socket.remoteAddress} - ${JSON.stringify(req.body)}`);
console.log(`Incoming request from ${req.headers['cf-connecting-ip'] || req.headers['x-forwarded-for'] || req.socket.remoteAddress} - ${JSON.stringify(req.body)}`);
next();
}