Skip to main content

validate_public_https_url

Function validate_public_https_url 

Source
pub fn validate_public_https_url(url: &str) -> Result<(), UrlPolicyError>
Expand description

Check that url is a plain public https URL: scheme https (any case), no userinfo, a host that is a public IP literal or a multi-label name, and no localhost, .localhost, .local or .internal name. The check reads the string only; it does not resolve the host. The SSRF guard of crate::Client still vets the resolved addresses on every request. Query strings and fragments are allowed and not inspected.