diff --git a/ibind/base/rest_client.py b/ibind/base/rest_client.py index 9113f50a..bbc5e842 100644 --- a/ibind/base/rest_client.py +++ b/ibind/base/rest_client.py @@ -147,6 +147,7 @@ def request(self, method: str, endpoint: str, attempt: int = 0, log: bool = True Exception: For any other errors that occur during the request. """ + endpoint = endpoint.lstrip("/") url = f"{self.base_url}{endpoint}" # we want to allow default values used by IBKR, so we remove all None parameters diff --git a/test/integration/base/test_rest_client_i.py b/test/integration/base/test_rest_client_i.py index a9ce10c3..a9d5825c 100644 --- a/test/integration/base/test_rest_client_i.py +++ b/test/integration/base/test_rest_client_i.py @@ -26,7 +26,7 @@ def setUp(self): self.response = MagicMock() self.response.json.return_value = self.data - self.default_path = '/test/api/route' + self.default_path = 'test/api/route' self.default_url = f'{self.url}/{self.default_path}' self.result = Result(data=self.data, request={'url': self.default_url}) self.maxDiff = 9999