def abs.hostport
import bend-net-url@0.4.0.0/url.bend as Urlimport Base
344# §3.2.2: hosts are case-insensitive. IPv6 literals are refused (IPv4-only runtime).
345def abs.hostport(scheme: String, dflt: Maybe<&2, U32>, hp: String & String, rest: String) -> Maybe<&2, Abs>:
346 (+host, ps) = hp
347 abs.hostok(scheme, String.to_lower(host), abs.port(ps, dflt), rest, Bool.not(Bool.or(String.is_empty(host), String.starts_with(host, "["))))