Skip to content

Commit 902ab07

Browse files
improved base_url parsing
1 parent ae2d48f commit 902ab07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

minds/rest_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ def __init__(self, api_key, base_url=None, version='v1'):
2424
base_url = 'https://mdb.ai'
2525

2626
base_url = base_url.rstrip('/')
27-
if not base_url.endswith('/api'):
27+
if not base_url.endswith('/api') and not base_url.endswith(f'/api/{version}'):
2828
base_url = base_url + '/api'
29-
if version is not None:
29+
if version and not base_url.endswith(f'/api/{version}'):
3030
base_url = base_url + '/' + version.lstrip('/')
3131
self.api_key = api_key
3232
self.base_url = base_url

0 commit comments

Comments
 (0)