diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-12-10 16:48:41 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-12-10 16:48:41 +0200 |
commit | 6da01ca75352378f26cde294eb5632fc75505a47 (patch) | |
tree | f96a2fcee8cd8aa9b581a25ea500fd663ccb0b7f /api | |
parent | 976c64f241e38e220065e698b2d6152068e9bc73 (diff) | |
download | arching-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-x | api/index.js | 5 |
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) |