def host_field.wrap
import bend-kit-url@0.4.1.0/url.bend as Urlimport Base
425# RFC 9110 §7.2: bracket an IPv6 literal in Host, and omit the default port.
426def host_field.wrap(host: String, ipv6: Bool) -> String:
427 match ipv6:
428 case True{}:
429 "[" ++ host ++ "]"
430 case False{}:
431 host