mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-04-08 20:40:57 -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
|
||||
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();
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue