pub(crate) fn sanitize_uri(uri: &str) -> StringExpand description
Sanitizes a single URI string by ensuring it has a proper scheme.
Mirrors the logic from the iOS fixURLIfNeeded() method:
- If the URI is already a valid URL, return as-is.
- If prepending
http://yields a URL whose host is an IPv4 address, usehttp://. - If the URI doesn’t already start with
http, prependhttps://. - Otherwise, return as-is.