From a637f6bb5a28e0d952849d474fd5e0285d33937e Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 1 Aug 2021 10:19:56 +0200 Subject: ip: Trust that express has applied x-forwarded-for already --- modules/ip/ip.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/ip') diff --git a/modules/ip/ip.js b/modules/ip/ip.js index 08fcf07..49de257 100644 --- a/modules/ip/ip.js +++ b/modules/ip/ip.js @@ -3,8 +3,6 @@ var cmn=require("../$common.js"), module.exports=function(app,io,moddir){ app.get("/ip",function(req,res){ - var ip=req.headers["x-forwarded-for"]; - if(ip)res.send(ip); - else res.send(String(req.socket.remoteAddress)); + res.send(req.ip); }); }; -- cgit v1.2.3-70-g09d2