diff --git a/yubihsm/backends/http.py b/yubihsm/backends/http.py index 80de3ea..e413bab 100644 --- a/yubihsm/backends/http.py +++ b/yubihsm/backends/http.py @@ -34,12 +34,17 @@ def __init__( By default, the backend will attempt to connect to a connector running locally, on the default port. - :param str url: (optional) The URL to connect to. + :param str url: (optional) The URL (scheme & domain or full path) to + connect to. :param timeout: (optional) A timeout in seconds, or a tuple of two values to use as connection timeout and request timeout. :type timeout: int or tuple[int, int] """ - self._url = parse.urljoin(url, "connector/api") + + if not parse.urlparse(url).path: + self._url = parse.urljoin(url, "connector/api") + else: + self._url = url self._timeout = timeout self._session = requests.Session()