Skip to main content

validate_url

Function validate_url 

Source
pub fn validate_url(url_str: &str) -> Result<Url, SecurityError>
Expand description

Validate a URL: must be http/https, must not resolve to private/localhost IPs.

Note: this is a static check only. It does not protect against DNS rebinding attacks where a public hostname resolves to a private IP at request time. For full SSRF protection, also check the resolved IP after DNS lookup.