Skip to main content

origin_of

Function origin_of 

Source
pub fn origin_of(url: &str) -> String
Expand description

Extract the origin (scheme://host[:port]) from a URL string, stripping any path/query/fragment. Best-effort string slicing — no full URL parser dep. Public so router crates can reuse the same logic when comparing redirect URLs against the trusted-origins list.