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.
ยงErrors
Returns an error when the origin is empty, malformed, lacks an HTTP(S) scheme or authority, or contains userinfo, a query, or a non-root path.