MCPcopy Create free account
hub / github.com/github/spec-kit / _validate_url

Method _validate_url

src/specify_cli/workflows/catalog.py:951–963  ·  view source on GitHub ↗
(url: str)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

StepCatalogErrorClass · 0.85

Tested by

no test coverage detected