SDK: Remove unused module (#5695)

main
Roman Donchenko 3 years ago committed by GitHub
parent e60127001c
commit 1ab80f87c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,28 +0,0 @@
# Copyright (C) 2022 CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
from typing import Optional
import requests
def detect_schema(url: str) -> Optional[str]:
"""
Attempts to detect URL schema (http or https) if none provided in the URL.
"""
if url.startswith("http://") or url.startswith("https://"):
return url
for schema in ["https://", "http://"]:
try:
v = schema + url
response = requests.request("GET", v)
response.raise_for_status()
return v
except requests.HTTPError:
pass
return None
Loading…
Cancel
Save