diff options
-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) |