Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 0272f1b

Browse files
fix: update render_path for get_public_url
1 parent 42a9ed3 commit 0272f1b

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

storage3/_async/file_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ async def get_public_url(self, path: str, options: TransformOptions = {}) -> str
8282
file path, including the path and file name. For example `folder/image.png`.
8383
"""
8484
render_path = (
85-
"render/image/authenticated" if options.get("transform") else "object"
85+
"render/image" if options.get("transform") else "object"
8686
)
8787
transformation_query = urllib.parse.urlencode(options)
8888
query_string = f"/?{transformation_query}" if transformation_query else ""
8989
_path = self._get_final_path(path)
90-
return f"{self._client.base_url}{render_path}/public/{_path}{query_string}"
90+
return f"{self._client.base_url}{render_path}/public{_path}{query_string}"
9191

9292
async def move(self, from_path: str, to_path: str) -> dict[str, str]:
9393
"""

storage3/_sync/bucket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from httpx import HTTPError, Response
66

77
from ..types import RequestMethod
8-
from ..utils import StorageException, SyncClient
8+
from ..utils import SyncClient, StorageException
99
from .file_api import SyncBucket
1010

1111
__all__ = ["SyncStorageBucketAPI"]

storage3/_sync/file_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
RequestMethod,
1717
TransformOptions,
1818
)
19-
from ..utils import StorageException, SyncClient
19+
from ..utils import SyncClient, StorageException
2020

2121
__all__ = ["SyncBucket"]
2222

@@ -82,12 +82,12 @@ def get_public_url(self, path: str, options: TransformOptions = {}) -> str:
8282
file path, including the path and file name. For example `folder/image.png`.
8383
"""
8484
render_path = (
85-
"render/image/authenticated" if options.get("transform") else "object"
85+
"render/image" if options.get("transform") else "object"
8686
)
8787
transformation_query = urllib.parse.urlencode(options)
8888
query_string = f"/?{transformation_query}" if transformation_query else ""
8989
_path = self._get_final_path(path)
90-
return f"{self._client.base_url}{render_path}/public/{_path}{query_string}"
90+
return f"{self._client.base_url}{render_path}/public{_path}{query_string}"
9191

9292
def move(self, from_path: str, to_path: str) -> dict[str, str]:
9393
"""

tests/_sync/test_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ def bucket(storage: SyncStorageClient, uuid_factory: Callable[[], str]) -> str:
7979

8080

8181
@pytest.fixture(scope="module")
82-
def public_bucket(storage: SyncStorageClient, uuid_factory: Callable[[], str]) -> str:
82+
def public_bucket(
83+
storage: SyncStorageClient, uuid_factory: Callable[[], str]
84+
) -> str:
8385
"""Creates a test public bucket which will be used in the whole storage tests run and deleted at the end"""
8486
bucket_id = uuid_factory()
8587

0 commit comments

Comments
 (0)