fix(ip-utils): Fix IP wildcard/shorthand handling and add validation test
This commit is contained in:
@@ -393,7 +393,8 @@ export class RouteValidator {
|
||||
// Check for wildcards in IPv4
|
||||
if (ip.includes('*') && !ip.includes(':')) {
|
||||
const parts = ip.split('.');
|
||||
if (parts.length !== 4) return false;
|
||||
// Allow 1-4 parts for wildcard patterns (e.g., '10.*', '192.168.*', '192.168.1.*')
|
||||
if (parts.length < 1 || parts.length > 4) return false;
|
||||
|
||||
for (const part of parts) {
|
||||
if (part !== '*' && !/^\d{1,3}$/.test(part)) return false;
|
||||
|
||||
Reference in New Issue
Block a user