diff options
Diffstat (limited to 'api/lib/checkIfAllowedIP/index.js')
-rw-r--r-- | api/lib/checkIfAllowedIP/index.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/api/lib/checkIfAllowedIP/index.js b/api/lib/checkIfAllowedIP/index.js index d9693d9..2e50418 100644 --- a/api/lib/checkIfAllowedIP/index.js +++ b/api/lib/checkIfAllowedIP/index.js @@ -1,8 +1,9 @@ - -module.exports = (address) => { +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; }; +module.exports = checkIfAllowedIP; |