Skip to main content

normalize

Function normalize 

Source
pub fn normalize(base: &Url, href: &str) -> Option<Url>
Expand description

Resolves href against base and normalises it. Returns None for links that aren’t crawlable pages: non-HTTP schemes, fragment-only links and blanks.

On top of what the URL parser already does (lowercase scheme and host, punycode, default ports, dot segments), this drops the fragment and a trailing dot on the host, upper-cases percent-escapes and decodes escaped unreserved characters. An empty query (/a?) is dropped; other query strings are kept as written.