normalize_origin_with_additional_schemes

Function normalize_origin_with_additional_schemes 

Source
pub fn normalize_origin_with_additional_schemes(
    origin: &str,
    allow_wildcard: bool,
    additional_schemes: &[&str],
) -> Result<String>
Expand description

Normalizes an origin while accepting explicitly selected non-HTTP schemes.

Additional schemes only affect syntax validation. Callers must still apply their own exact origin allowlist; accepting a scheme here does not authorize every origin using that scheme.

ยงErrors

Returns an error when the origin is empty or malformed, its scheme is not HTTP(S) or listed in additional_schemes, it has no authority, or it contains userinfo, a query, or a non-root path.