diff options
author | Tom Smeding <tom@tomsmeding.com> | 2021-08-01 10:19:56 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2021-08-01 10:20:56 +0200 |
commit | a637f6bb5a28e0d952849d474fd5e0285d33937e (patch) | |
tree | a059d5ef804b202031234b9b772deee30ee46611 | |
parent | 6c24962a0c8d1f432920ead0c7be1d7e5cf85787 (diff) |
ip: Trust that express has applied x-forwarded-for already
-rw-r--r-- | modules/ip/ip.js | 4 |
1 files changed, 1 insertions, 3 deletions
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); }); }; |