summaryrefslogtreecommitdiff
path: root/modules/ip
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-08-01 10:19:56 +0200
committerTom Smeding <tom@tomsmeding.com>2021-08-01 10:20:56 +0200
commita637f6bb5a28e0d952849d474fd5e0285d33937e (patch)
treea059d5ef804b202031234b9b772deee30ee46611 /modules/ip
parent6c24962a0c8d1f432920ead0c7be1d7e5cf85787 (diff)
ip: Trust that express has applied x-forwarded-for already
Diffstat (limited to 'modules/ip')
-rw-r--r--modules/ip/ip.js4
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);
});
};