replace ipaddr.js
This commit is contained in:
@@ -16,7 +16,7 @@ const assert = require('assert'),
|
||||
constants = require('./constants.js'),
|
||||
debug = require('debug')('box:directoryserver'),
|
||||
eventlog = require('./eventlog.js'),
|
||||
ipaddr = require('ipaddr.js'),
|
||||
ipaddr = require('./ipaddr.js'),
|
||||
groups = require('./groups.js'),
|
||||
ldap = require('ldapjs'),
|
||||
path = require('path'),
|
||||
@@ -56,7 +56,6 @@ async function validateConfig(config) {
|
||||
for (const line of allowlist.split('\n')) {
|
||||
if (!line || line.startsWith('#')) continue;
|
||||
const rangeOrIP = line.trim();
|
||||
// this checks for IPv4 and IPv6
|
||||
if (!ipaddr.isValid(rangeOrIP) && !ipaddr.isValidCIDR(rangeOrIP)) throw new BoxError(BoxError.BAD_FIELD, `${rangeOrIP} is not a valid IP or range`);
|
||||
gotOne = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user