Replies: 2 comments 4 replies
-
|
I'm somewhat reluctant to support Would that be somewhat helpful? |
Beta Was this translation helpful? Give feedback.
-
|
I'm curious why you're reluctant to support returning false. As a user, I don't really want to worry about IPv4 vs IPv6 in my code. As both a IPv4 and a IPv6 are IP addresses, in my code I just want to worry about IP addresses. Worrying about the nuance between IPv4 and IPv6 is exactly the kind of problem I want a library to abstract away for me. I was able to mitigate this pretty quickly with a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It's a fairly common need to check if one IP is within the range of a subnet, for example:
In this case the second address will likely be form an external source, and as such might not be the same IP version.
I would expect the following to return false:
because '10.0.0.0/8' definitely does not include
::1. However, it currently throws an exception:This bit me today where the test environment was not sufficient to trigger this error. I was expecting false, not an exception.
This was reported in #56, opening as a discussion as requested.
Beta Was this translation helpful? Give feedback.
All reactions