quote the value in error message
This commit is contained in:
@@ -764,7 +764,7 @@ async function setTrustedIps(trustedIps) {
|
||||
for (const line of trustedIps.split('\n')) {
|
||||
if (!line || line.startsWith('#')) continue;
|
||||
const rangeOrIP = line.trim();
|
||||
if (!ipaddr.isValid(rangeOrIP) && !ipaddr.isValidCIDR(rangeOrIP)) throw new BoxError(BoxError.BAD_FIELD, `${rangeOrIP} is not a valid IP or range`);
|
||||
if (!ipaddr.isValid(rangeOrIP) && !ipaddr.isValidCIDR(rangeOrIP)) throw new BoxError(BoxError.BAD_FIELD, `'${rangeOrIP}' is not a valid IP or range`);
|
||||
trustedIpsConfig += `set_real_ip_from ${rangeOrIP};\n`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user