diff --git a/index.js b/index.js index a1da3fe..a3244ff 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ app.set('trust proxy', true) app.use(express.static('static')); app.post('/', async function (req, res) { - let ip = req.headers.get('X-Real-IP') || req.ip; + let ip = req.headers['X-Real-IP'] || req.ip; let id = 'web:' + createHash('sha256').update(ip).digest('hex'); console.log(ip); id = id.slice(0, 24); diff --git a/static/index.html b/static/index.html index 0fe8b2b..0607a84 100644 --- a/static/index.html +++ b/static/index.html @@ -12,7 +12,7 @@