fix(utils/ipaddr): render the unspecified address binary as "::" (#4998)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
`convertIPv6BinaryToString(0n)` returned a single ":" instead of the canonical "::" for the IPv6 unspecified address. The all-zero address compresses every group, so the generic zero-run logic collapsed the sections array down to a lone ":" placeholder, which the trailing `/:{2,}/` replacement could not fix because it only collapses runs of two or more colons. This produced an invalid IPv6 string (`net.isIP(':')` is `0`) and broke the round-trip with `convertIPv6ToBinary`, which throws on ":". It also meant the unspecified address was canonicalized to a bogus key in the ip-restriction middleware's string rule map, so a rule such as `denyList: ['::']` could be registered under ":" rather than "::". Handle the all-zero value explicitly, mirroring the existing IPv4-mapped early return.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+13 added−0 removed
- tests:+7 added−0 removed
- other:+6 added−0 removed