test: fix test if ip is invalid

isekai-main
Barış Soner Uşaklı 2 years ago
parent e8fb02f3f7
commit 3837798292

@ -49,6 +49,10 @@ Blacklist.test = async function (clientIp) {
}
clientIp = clientIp.split(':').length === 2 ? clientIp.split(':')[0] : clientIp;
if (!validator.isIP(clientIp)) {
throw new Error('[[error:invalid-ip]]');
}
const rules = Blacklist._rules;
function checkCidrRange(clientIP) {
if (!rules.cidr.length) {

Loading…
Cancel
Save