Ask a question to get started
Enter to send•Shift+Enter new line
Check if a URL is safe (non-throwing version of validate_safe_url).
is_safe_url( url: str | AnyHttpUrl, *, allow_private: bool = False, allow_http: bool = True ) -> bool
url
str | AnyHttpUrl
The URL to check
allow_private
bool
False
If True, allows private IPs and localhost
allow_http
True
If True, allows both HTTP and HTTPS