Authority.isIPv6Literal

bool isIPv6Literal(const string h) @nogc nothrow @safe

Returns true if h looks like an IPv6 literal.

IPv6 addresses always contain colons. IPv4-mapped IPv6 addresses like ::ffff:192.0.2.1 contain both colons and dots but are still IPv6.

This heuristic checks for the presence of colons, which is the defining characteristic of IPv6.

Parameters

hHost string (without brackets).

Returns

true if it matches the heuristic, false otherwise.