diff --git a/src/storage/src/storage3/_async/file_api.py b/src/storage/src/storage3/_async/file_api.py index ca8aaab6..4993671a 100644 --- a/src/storage/src/storage3/_async/file_api.py +++ b/src/storage/src/storage3/_async/file_api.py @@ -111,7 +111,7 @@ async def create_signed_upload_url( ) data = response.json() full_url: urllib.parse.ParseResult = urllib.parse.urlparse( - str(self._client.base_url) + cast(str, data["url"]).lstrip("/") + str(self._base_url) + cast(str, data["url"]).lstrip("/") ) query_params = urllib.parse.parse_qs(full_url.query) if not query_params.get("token"): diff --git a/src/storage/src/storage3/_sync/file_api.py b/src/storage/src/storage3/_sync/file_api.py index 6864366e..b1be7bcc 100644 --- a/src/storage/src/storage3/_sync/file_api.py +++ b/src/storage/src/storage3/_sync/file_api.py @@ -111,7 +111,7 @@ def create_signed_upload_url( ) data = response.json() full_url: urllib.parse.ParseResult = urllib.parse.urlparse( - str(self._client.base_url) + cast(str, data["url"]).lstrip("/") + str(self._base_url) + cast(str, data["url"]).lstrip("/") ) query_params = urllib.parse.parse_qs(full_url.query) if not query_params.get("token"): diff --git a/src/storage/tests/_async/test_client.py b/src/storage/tests/_async/test_client.py index ed041a60..85abddc2 100644 --- a/src/storage/tests/_async/test_client.py +++ b/src/storage/tests/_async/test_client.py @@ -322,7 +322,7 @@ async def test_client_create_signed_upload_url( data = await storage_file_client.create_signed_upload_url(path) assert data["path"] == path assert data["token"] - expected_url = f"{storage_file_client._client.base_url}object/upload/sign/{storage_file_client.id}/{path.lstrip('/')}" + expected_url = f"{storage_file_client._base_url}object/upload/sign/{storage_file_client.id}/{path.lstrip('/')}" assert data["signed_url"].startswith(expected_url) diff --git a/src/storage/tests/_sync/test_client.py b/src/storage/tests/_sync/test_client.py index 51f09e76..b549db0f 100644 --- a/src/storage/tests/_sync/test_client.py +++ b/src/storage/tests/_sync/test_client.py @@ -322,7 +322,7 @@ def test_client_create_signed_upload_url( data = storage_file_client.create_signed_upload_url(path) assert data["path"] == path assert data["token"] - expected_url = f"{storage_file_client._client.base_url}object/upload/sign/{storage_file_client.id}/{path.lstrip('/')}" + expected_url = f"{storage_file_client._base_url}object/upload/sign/{storage_file_client.id}/{path.lstrip('/')}" assert data["signed_url"].startswith(expected_url)