From 30019cc04f4ded9a1dcc0e46782182238e2a1a3a Mon Sep 17 00:00:00 2001 From: Leonardo Santiago Date: Mon, 3 Nov 2025 13:45:55 -0300 Subject: [PATCH 1/2] fix(storage): read _base_url instead of _client.base_url inside signed url creation --- src/storage/src/storage3/_async/file_api.py | 2 +- src/storage/tests/_async/test_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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) From 93a8d862e41d134db760a176b31503e37786fa49 Mon Sep 17 00:00:00 2001 From: Leonardo Santiago Date: Mon, 3 Nov 2025 13:48:50 -0300 Subject: [PATCH 2/2] fix(storage): also change sync version --- src/storage/src/storage3/_sync/file_api.py | 2 +- src/storage/tests/_sync/test_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/_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)