Skip to main content

validate_url

Function validate_url 

Source
pub fn validate_url(url: &Url) -> Result<Vec<SocketAddr>, BlockedUrl>
Expand description

Validate a URL’s scheme and resolve+classify its host. On success returns the validated socket addresses (host resolved to public IPs) so the caller can pin the connection and avoid a DNS-rebinding TOCTOU window.

A no-op (returns Ok(vec![])) when the guard is disabled via env.