(url: str)
| 949 | from specify_cli.authentication.http import open_url as _open_url |
| 950 | |
| 951 | def _validate_url(url: str) -> None: |
| 952 | parsed = urlparse(url) |
| 953 | is_localhost = parsed.hostname in ("localhost", "127.0.0.1", "::1") |
| 954 | if parsed.scheme != "https" and not ( |
| 955 | parsed.scheme == "http" and is_localhost |
| 956 | ): |
| 957 | raise StepCatalogError( |
| 958 | f"Refusing to fetch catalog from non-HTTPS URL: {url}" |
| 959 | ) |
| 960 | if not parsed.hostname: |
| 961 | raise StepCatalogError( |
| 962 | f"Refusing to fetch catalog from URL with no hostname: {url}" |
| 963 | ) |
| 964 | |
| 965 | _validate_url(entry.url) |
| 966 |
nothing calls this directly
no test coverage detected