fix: cf header

This commit is contained in:
Mike 2025-01-01 16:48:29 -05:00
parent acc580fb79
commit b847c0f231

View file

@ -17,8 +17,7 @@ app.use(express.urlencoded({ extended: true }));
//Logging
app.use((req, res, next) => {
req.time = new Date(Date.now()).toISOString();
const clientIp =
req.header("http_cf_connecting_ip") || req.socket.remoteAddress;
const clientIp = req.header("cf_connecting_ip") || req.socket.remoteAddress;
console.log(req.time, req.method, req.hostname, req.path, clientIp);
next();
});