mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 13:20:41 +01:00
test: fix test if ip is invalid
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user