mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-04-18 23:41:17 -04:00
fix: cf header
This commit is contained in:
parent
acc580fb79
commit
b847c0f231
1 changed files with 1 additions and 2 deletions
|
@ -17,8 +17,7 @@ app.use(express.urlencoded({ extended: true }));
|
||||||
//Logging
|
//Logging
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
req.time = new Date(Date.now()).toISOString();
|
req.time = new Date(Date.now()).toISOString();
|
||||||
const clientIp =
|
const clientIp = req.header("cf_connecting_ip") || req.socket.remoteAddress;
|
||||||
req.header("http_cf_connecting_ip") || req.socket.remoteAddress;
|
|
||||||
console.log(req.time, req.method, req.hostname, req.path, clientIp);
|
console.log(req.time, req.method, req.hostname, req.path, clientIp);
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue