Conversation
it is possible to have ip value of null, for example from express.
|
you forgot to add link to your mentioned pull request |
|
what's the current behavior? as maybe more accurate is to raise an error instead? |
|
what is the scenario where express returns |
|
@glensc - you have probably right here, this function should throw an error if the input is invalid, check code there is already at least one other function who does it also. So updated my changes, so now it throws error if not valid ipv4 |
|
and there can be one more issue - ipv4 aadresses embeded into ipv6 ... in our case few examples for those
|
|
hint: disable ipv6 listen in your express application (listen to ipv4_all: 0.0.0.0) |
| ip.toLong(null); | ||
| }, Error); | ||
| assert.throws(function () { | ||
| ip.toLong(undefined); |
There was a problem hiding this comment.
I would end up testing here this .isV4Format more as in the end this will be used to validated input - so just added few possible values that can perhaps happens as bad input other than ipv6
This pull request is adding input validation for
toLongmethod as for example it is possible to only get long values from ipv4 addresses.