aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-12-10 16:48:41 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-12-10 16:48:41 +0200
commit6da01ca75352378f26cde294eb5632fc75505a47 (patch)
treef96a2fcee8cd8aa9b581a25ea500fd663ccb0b7f /api
parent976c64f241e38e220065e698b2d6152068e9bc73 (diff)
downloadarching-kaos-tools-6da01ca75352378f26cde294eb5632fc75505a47.tar.gz
arching-kaos-tools-6da01ca75352378f26cde294eb5632fc75505a47.tar.bz2
arching-kaos-tools-6da01ca75352378f26cde294eb5632fc75505a47.zip
Expanding API to return calls from both hyperboria and yggdrasil networks
Diffstat (limited to 'api')
-rwxr-xr-xapi/index.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/api/index.js b/api/index.js
index 2646a9c..f61b339 100755
--- a/api/index.js
+++ b/api/index.js
@@ -99,7 +99,10 @@ function processMethod(req, res)
function checkIfAllowedIP(address)
{
- return address.startsWith('fc') ? true : false;
+ 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)