File tree Expand file tree Collapse file tree
src/label_studio_sdk/tokens Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import threading
2+ import urllib .parse
23import typing
34from datetime import datetime , timezone
45import ssl
@@ -117,7 +118,7 @@ def refresh(self) -> TokenRefreshResponse:
117118 if isinstance (existing_client , httpx .Client ):
118119 response = existing_client .request (
119120 method = "POST" ,
120- url = f"{ self ._base_url } / api/token/refresh/" ,
121+ url = urllib . parse . urljoin ( f"{ self ._base_url } " , " api/token/refresh/") ,
121122 json = {"refresh" : self ._api_key },
122123 headers = {"Content-Type" : "application/json" },
123124 )
@@ -128,7 +129,7 @@ def refresh(self) -> TokenRefreshResponse:
128129 with httpx .Client (** client_params ) as sync_client :
129130 response = sync_client .request (
130131 method = "POST" ,
131- url = f"{ self ._base_url } /api/token/refresh/" ,
132+ url = urllib . parse . urljoin ( f"{ self ._base_url } /" , " api/token/refresh/") ,
132133 json = {"refresh" : self ._api_key },
133134 headers = {"Content-Type" : "application/json" },
134135 )
You can’t perform that action at this time.
0 commit comments