Skip to main content

validate_url

Function validate_url 

Source
pub fn validate_url(raw: &str) -> Result<ValidatedUrl, FetchError>
Expand description

Parse, normalize, and validate a URL.

Rejects:

  • Non-http(s) schemes (detected later by policy, but data:/javascript: rejected here)
  • URLs with embedded credentials
  • IP addresses encoded as hex, octal, or decimal integers
  • Hosts that are empty after normalization