Use req.ip properly
This commit is contained in:
parent
86fd430d46
commit
56f46086ff
2
index.js
2
index.js
|
|
@ -1043,7 +1043,7 @@ const logCall = (caller, callee, srcIp) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const genCall = (req, res, apiKey, ani, number) => {
|
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 => {
|
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 = ? 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
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue