Skip to content

Commit

Permalink
Fix parsing of connector URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Sep 20, 2023
1 parent fa0682a commit 4837bfb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions yubihsm/backends/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4837bfb

Please sign in to comment.