Skip to main content

normalize_host

Function normalize_host 

Source
pub fn normalize_host(authority: &str, port: Port) -> Option<String>
Expand description

A host as written by hand — a domain typed into a form, or taken from a handle — in the form hosts are compared in: lower case, percent-encoding decoded, an internationalised name in its ASCII form (IDNA), and a single trailing dot left off, as Addressable::URI#normalized_host has it. The port is kept or left out as port says. None when it is empty or is not a host, such as one with a space, / or @ in it.