Return True if the url ends with one of the extensions provided
(url: UrlT, extensions: Iterable[str])
| 39 | |
| 40 | |
| 41 | def url_has_any_extension(url: UrlT, extensions: Iterable[str]) -> bool: |
| 42 | """Return True if the url ends with one of the extensions provided""" |
| 43 | lowercase_path = parse_url(url).path.lower() |
| 44 | return any(lowercase_path.endswith(ext) for ext in extensions) |
| 45 | |
| 46 | |
| 47 | def add_http_if_no_scheme(url: str) -> str: |
no outgoing calls