From 56f46086ffabbae36d15ab4242ffbc2799c9660a Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 18 Feb 2026 13:28:36 -0700 Subject: [PATCH] Use req.ip properly --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c8058b4..fa45e2b 100644 --- a/index.js +++ b/index.js @@ -1043,7 +1043,7 @@ const logCall = (caller, callee, srcIp) => { } const genCall = (req, res, apiKey, ani, number) => { - const srcIp = process.env.PROXY_HEADER ? req.headers[process.env.PROXY_HEADER] : req.remoteAddress; + const srcIp = process.env.PROXY_HEADER ? req.headers[process.env.PROXY_HEADER] : req.ip; pool.getConnection().then(conn => { //conn.query("SELECT * FROM routes WHERE apiKey = ? AND block_start <= ? AND block_start + block_length >= ?", [apiKey, ani, ani]).then((rows) => { conn.query("SELECT * FROM routes WHERE apiKey = ?", [apiKey]).then((rows) => { // We'll try this Nick, if it doesn't work we'll go back to the original