You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dns: getServers returns IPv6 addresses without [] #13795
I think a bare IPv6 without [] is fine as long as it's not in an contained in an URL. Also see rfc5952 which suggests to only use[] when a port is included.
I was going by rfc3986, which is ratified while rfc5952 is still "proposed".
IMHO this issue is not urgent and could stay open forever, or closed with known limitation.
rfc3986 is about URIs, which I think host:port is not (IIRC, a valid URI always requires a protocol). Anyways, If you want to treat it like an URL, you can use the legacy url module to format it (not sure if the same is possible using WHATWG URL, as it doesn't allow calling the constructor without arguments):
Declaring a DNS server like this is rather uncommon. Why not require and return [] style IPv6 when port is specified and not 53, e.g.:
(again for context, I think this is of very low priority if at all, I just enjoy the discussion)
Passing URLs (in and out) eliminates hand spun parsing code, by us in setServers and by the user in getServers
We could as well "re-invent" a degenerated URL {addr, port} but even then we'll need to validate that addr is a string representing an IP, and port is a valid port number (0 < port < 2**16-1)
Closing as known limitation. Feel absolutely free to re-open or comment if you feel it should stay open, especially if you think it might be addressed some point in the not-too-distant future.
Activity
refack commentedon Jun 19, 2017
Ref: nodejs/node-v0.x-archive#5435
refack commentedon Jun 19, 2017
I just noticed this, IMHO we should format IPv6 with
[]:e.g.
Fix will be
semver-majorsilverwind commentedon Jun 19, 2017
I think a bare IPv6 without
[]is fine as long as it's not in an contained in an URL. Also see rfc5952 which suggests to only use[]when a port is included.refack commentedon Jun 19, 2017
I was going by rfc3986, which is ratified while rfc5952 is still "proposed".
IMHO this issue is not urgent and could stay open forever, or closed with
known limitation.silverwind commentedon Jun 19, 2017
rfc3986 is about URIs, which I think host:port is not (IIRC, a valid URI always requires a protocol). Anyways, If you want to treat it like an URL, you can use the legacy url module to format it (not sure if the same is possible using WHATWG URL, as it doesn't allow calling the constructor without arguments):
refack commentedon Jun 19, 2017
As suggested just now #13723 (comment)
dns://[addr]:port...A
semver-majorfix could return a list ofdns://URLs (even raw nottoStringed) 🤷♂️refack commentedon Jun 19, 2017
💡
🤓
Or add
getServersURLs()assemver-minor(orgetServers(true))silverwind commentedon Jun 19, 2017
Declaring a DNS server like this is rather uncommon. Why not require and return
[]style IPv6 when port is specified and not 53, e.g.:refack commentedon Jun 19, 2017
(again for context, I think this is of very low priority if at all, I just enjoy the discussion)
Passing
URLs (in and out) eliminates hand spun parsing code, by us insetServersand by the user ingetServersWe could as well "re-invent" a degenerated URL
{addr, port}but even then we'll need to validate thataddris a string representing an IP, andportis a valid port number (0 < port < 2**16-1)Trott commentedon Jun 7, 2018
Closing as known limitation. Feel absolutely free to re-open or comment if you feel it should stay open, especially if you think it might be addressed some point in the not-too-distant future.