fix: enclose ipv6 host with brackets on client request#1243
fix: enclose ipv6 host with brackets on client request#1243harshavardhana merged 6 commits intominio:masterfrom aldy505:fix/host-header-ipv6-url
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