-
Notifications
You must be signed in to change notification settings - Fork 282
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
fix: enclose ipv6 host with brackets on client request #1243
fix: enclose ipv6 host with brackets on client request #1243
Conversation
can't we just check |
I don't think that makes that much of a difference. See this sample code: const net = require("net");
const input = ["localhost", "postgres.arpa", "172.16.0.1", "valid-domain.com", "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "::1234:5678", "::", "::1234:5678:91.123.4.56", "::11.22.33.44"];
for (const i of input) {
console.log(`Input: ${i}; IsIP? ${net.isIP(i)};`);
}
// Output:
// Input: localhost; IsIP? 0;
// Input: postgres.arpa; IsIP? 0;
// Input: 172.16.0.1; IsIP? 4;
// Input: valid-domain.com; IsIP? 0;
// Input: 2001:0db8:85a3:0000:0000:8a2e:0370:7334; IsIP? 6;
// Input: ::1234:5678; IsIP? 6;
// Input: ::; IsIP? 6;
// Input: ::1234:5678:91.123.4.56; IsIP? 6;
// Input: ::11.22.33.44; IsIP? 6; |
some downstream users are using this package in web environment, using |
I feel like I'm missing something here. What about all those Another side note: We should make this clear on README for what environment we support. |
Request for review @trim21 @prakashsvmx |
Adding some unit test would be beneficial @aldy505 |
Done |
Lgtm |
Thank you @aldy505 for the contribution. |
Closes #1241