-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
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
isIP('1.1.1.01') = true? #534
Comments
Is it invalid? There was some discussion in #490. |
For obvious reasons, it's invalid. Just a Javascript sample: var net = require('net');
var client = new net.Socket();
// 54.235.131.019 is ip address of api.ipify.org
client.connect(80, '54.235.131.019', function() {
client.write('GET / HTTP/1.1\r\nHost: api.ipify.org\r\n\r\n');
});
client.on('data', function(data) {
console.log('Received: ' + data);
client.destroy();
});
client.on('close', function() {
console.log('Connection closed');
}); If "54.235.131.019" is valid, then the program would get result. but not! BTW, The program get success result in Mac, but not in Linux(eg: Centos 7). |
Not saying that I disagree with you, but whether or not the node.js |
So on Mac OS X you get the same result with leading zeroes? |
On Mac OS X, IP with leading zeroes is ok. |
$ ping 8.8.8.010
PING 8.8.8.010 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=47 time=53.670 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=47 time=60.050 ms |
PING is OK(Mac and Linux), but not in node client. |
In WIKI:
That results in inconsistent result. |
Right, but leading zeroes are still technically valid in some cases. Whether or not |
Maybe it could be replaced by: |
"1.1.1.01" is an invalid ip address.
The text was updated successfully, but these errors were encountered: