added a todo suggestion

This commit is contained in:
Tom Broughton 2023-10-27 14:11:07 +01:00
parent 30914719aa
commit 0a032ab901

View file

@ -52,6 +52,7 @@ app.get('/headers', function (req, res) {
res.status(200).send('success'); res.status(200).send('success');
}); });
//restrict access to anything else via ip addresses based on x-forwarded for //restrict access to anything else via ip addresses based on x-forwarded for
//@todo create environment var to determin to used this or the general req header
let clientIp = function(req, res) { let clientIp = function(req, res) {
return req.headers['x-forwarded-for'] ? (req.headers['x-forwarded-for']).split(',')[0] : "" return req.headers['x-forwarded-for'] ? (req.headers['x-forwarded-for']).split(',')[0] : ""
}; };