Skip to main content

normalize_origin

Function normalize_origin 

Source
pub fn normalize_origin(origin: &str, allow_wildcard: bool) -> Result<String>
Expand description

Normalizes an HTTP origin for CORS and public-site comparisons.

The returned value is lowercase scheme://authority. Paths other than /, query strings, fragments, and userinfo are rejected. When allow_wildcard is true, * is returned unchanged.