aboutsummaryrefslogtreecommitdiff
path: root/api/routes/getRemoteNodeInfo
diff options
context:
space:
mode:
Diffstat (limited to 'api/routes/getRemoteNodeInfo')
-rw-r--r--api/routes/getRemoteNodeInfo/index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/routes/getRemoteNodeInfo/index.js b/api/routes/getRemoteNodeInfo/index.js
index 6cfff4b..a88f528 100644
--- a/api/routes/getRemoteNodeInfo/index.js
+++ b/api/routes/getRemoteNodeInfo/index.js
@@ -6,6 +6,7 @@
const { spawn } = require('child_process');
const config = require("../../config.js");
+const checkIfAllowedIP = require('../../lib/checkIfAllowedIP/index.js');
module.exports = (req, res) => {
var args = req.url.split("/");
@@ -15,7 +16,7 @@ module.exports = (req, res) => {
ip = args[3];
}
var test = /^fc[0-9a-z]{1,2}:([0-9a-z]{1,4}:){1,6}[0-9a-z]{1,4}/
- if (test.test(ip))
+ if (checkIfAllowedIP(ip))
{
const command = spawn("curl", ["--retry-max-time","3","-s",`http://[${ip}]:8610/v0/node_info`]);
var buffer = "";