MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / validate_url

Function validate_url

bota/src/bota/vm.py:786–796  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

784 write_file_sudo(apache_conf, "/etc/apache2/sites-available/000-default.conf")
785
786def validate_url(url):
787 try:
788 response = requests.head(url, allow_redirects=True, timeout=20)
789 response.raise_for_status()
790 except requests.exceptions.RequestException as e:
791 # Retry with GET if HEAD fails (some servers don't support HEAD)
792 try:
793 response = requests.get(url, allow_redirects=True, timeout=20)
794 response.raise_for_status()
795 except requests.exceptions.RequestException as e2:
796 raise Exception(f"The URL {url} does not point to a valid Debian installer.")
797
798def api_config_disabled(service_name, seconds):
799 """

Callers 2

Calls 1

getMethod · 0.45

Tested by

no test coverage detected