Skip to main content

host_of

Function host_of 

Source
pub fn host_of(url: &str) -> Result<Option<String>, AxError>
Expand description

The host a URL names, when it names one.

One authority for the whole workspace: the browser tool reading a page address and a building reading the address a person declared for their browser are the same question, and two parsers would answer it differently the first time either was corrected. The URL is read by the WHATWG URL Standard, the parser browsers follow, so the host the egress door judges is the host a browser connects to (D59): a backslash ends the authority of a special scheme, the host is percent-decoded and lowercased, and a number spells an IPv4 address. A URL with no authority - about:blank, a file: path, text with no scheme - names no host.

ยงErrors

Refuses a URL this build cannot read, which would leave an egress unjudged.