browserclaw 0.2.6 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1460,7 +1460,22 @@ function extractEmbeddedIPv4(lower) {
1460
1460
  }
1461
1461
  return null;
1462
1462
  }
1463
+ function isStrictDecimalOctet(part) {
1464
+ if (!/^[0-9]+$/.test(part)) return false;
1465
+ const n = parseInt(part, 10);
1466
+ if (n < 0 || n > 255) return false;
1467
+ if (String(n) !== part) return false;
1468
+ return true;
1469
+ }
1470
+ function isUnsupportedIPv4Literal(ip) {
1471
+ if (/^[0-9]+$/.test(ip)) return true;
1472
+ const parts = ip.split(".");
1473
+ if (parts.length !== 4) return true;
1474
+ if (!parts.every(isStrictDecimalOctet)) return true;
1475
+ return false;
1476
+ }
1463
1477
  function isInternalIP(ip) {
1478
+ if (!ip.includes(":") && isUnsupportedIPv4Literal(ip)) return true;
1464
1479
  if (/^127\./.test(ip)) return true;
1465
1480
  if (/^10\./.test(ip)) return true;
1466
1481
  if (/^172\.(1[6-9]|2\d|3[01])\./.test(ip)) return true;