From 1b005d0345ec24709c7cd8915cdb30cb30f59c91 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 18 Mar 2025 01:42:44 +0200 Subject: [api] exported function checkIfAllowedIP --- api/index.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'api/index.js') diff --git a/api/index.js b/api/index.js index 91ae7be..3394a0d 100755 --- a/api/index.js +++ b/api/index.js @@ -14,6 +14,7 @@ const getRemoteNodeInfo = require('./routes/getRemoteNodeInfo/index.js'); const getRemotePeers = require('./routes/getRemotePeers/index.js'); const akLogMessage = require('./lib/akLogMessage'); +const checkIfAllowedIP = require('./lib/checkIfAllowedIP/index.js'); akLogMessage('INFO', 'akLogMessage loaded'); const serverOptions = { keepAliveTimeout: 60000 }; @@ -99,14 +100,6 @@ function processMethod(req, res) } } -function checkIfAllowedIP(address) -{ - var test_cjdns = /^fc[0-9a-z]{1,2}:([0-9a-z]{1,4}:){1,6}[0-9a-z]{1,4}/ - var test_yggdrasil = /^2[0-9a-z]{1,2}:([0-9a-z]{1,4}:){1,6}[0-9a-z]{1,4}/ - var test_yggdrasil_sub = /^3[0-9a-z]{1,2}:([0-9a-z]{1,4}:){1,6}[0-9a-z]{1,4}/ - return (test_cjdns.test(address) || test_yggdrasil.test(address) || test_yggdrasil_sub.test(address)) ? true : false; -} - function requestParser(req, res) { printRequest(req); -- cgit v1.2.3