pub fn normalize_host(host: &str) -> Option<String>Expand description
Reduce a host or authority to a bare, comparable host name.
Lowercases, strips a trailing :port, and unwraps IPv6 brackets, so the
three spellings a single address arrives in — [::1]:8080 from a browser,
::1 from a config file, [::1] from a URL — compare equal.
Returns None for anything that cannot be a host: an empty string, or a
value carrying userinfo or a path. Those are rejected rather than
sanitized, because a Host header containing them is malformed and the
only safe reading of a malformed claim is no claim at all.