We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Currently, the isIPRange() method only supports IPv4 addresses. It should be extended to support IPv6 addresses as well.
isIPRange()
Examples
isIPRange("192.0.2.0/24") // IPv4 CIDR is `true` isIPRange("2001:db8::/32") // IPv6 CIDR is `false`
Additional context
The text was updated successfully, but these errors were encountered:
I suppose "isIPRange" check the string before '/' is valid IP or not. Maybe you should use valid ipv6 instead of "2001:db8::"
edit: sorry i've checked the code here the return statement of isIPRange
return isIP(parts[0], 4) && parts[1] <= 32 && parts[1] >= 0;
so it validate only IPv4. It may be rewritten as
return (isIP(parts[0], 4) && parts[1] <= 32 && parts[1] >= 0) || (isIP(parts[0],6) && parts[1] <= 64 && parts[1] >= 0);
You can open PR.
Sorry, something went wrong.
@AnandChowdhary I opened a PR. after they review, it can be merged
This PR should resolve this issue: #1594
Successfully merging a pull request may close this issue.
Describe the bug
Currently, the
isIPRange()
method only supports IPv4 addresses. It should be extended to support IPv6 addresses as well.Examples
Additional context
The text was updated successfully, but these errors were encountered: