(label: str, url: str)
| 786 | |
| 787 | |
| 788 | def _require_https(label: str, url: str) -> None: |
| 789 | from urllib.parse import urlparse |
| 790 | |
| 791 | parsed = urlparse(url) |
| 792 | is_localhost = parsed.hostname in ("localhost", "127.0.0.1", "::1") |
| 793 | if parsed.scheme != "https" and not (parsed.scheme == "http" and is_localhost): |
| 794 | raise BundlerError( |
| 795 | f"Refusing to download {label} over non-HTTPS URL: {url}" |
| 796 | ) |
| 797 | if not parsed.hostname: |
| 798 | raise BundlerError(f"Refusing to download {label} from URL with no host: {url}") |
| 799 | |
| 800 | |
| 801 | def _download_remote_manifest(entry_id: str, url: str): |
no test coverage detected