Skip to content

Commit

Permalink
restclient lstripps each endpoint from "/" to prevent double forwards…
Browse files Browse the repository at this point in the history
…lash "//"
  • Loading branch information
Voyz committed Sep 6, 2024
1 parent 545c98d commit f8e09a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ibind/base/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/integration/base/test_rest_client_i.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f8e09a4

Please sign in to comment.