Skip to content

Commit dd72fd6

Browse files
fix: handle stray /
1 parent 604e804 commit dd72fd6

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

storage3/_async/file_api.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
2-
import urllib.parse
32

3+
import urllib.parse
44
from dataclasses import dataclass, field
55
from io import BufferedReader, FileIO
66
from pathlib import Path
@@ -11,10 +11,10 @@
1111
from ..constants import DEFAULT_FILE_OPTIONS, DEFAULT_SEARCH_OPTIONS
1212
from ..types import (
1313
BaseBucket,
14-
ListBucketFilesOptions,
1514
CreateSignedURLOptions,
16-
TransformOptions,
15+
ListBucketFilesOptions,
1716
RequestMethod,
17+
TransformOptions,
1818
)
1919
from ..utils import AsyncClient, StorageException
2020

@@ -82,7 +82,7 @@ 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/authenticated" if options.get("transform") else "object"
8686
)
8787
transformation_query = urllib.parse.urlencode(options)
8888
query_string = f"/?{transformation_query}" if transformation_query else ""

storage3/_sync/file_api.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
2-
import urllib.parse
32

3+
import urllib.parse
44
from dataclasses import dataclass, field
55
from io import BufferedReader, FileIO
66
from pathlib import Path
@@ -11,10 +11,10 @@
1111
from ..constants import DEFAULT_FILE_OPTIONS, DEFAULT_SEARCH_OPTIONS
1212
from ..types import (
1313
BaseBucket,
14-
ListBucketFilesOptions,
1514
CreateSignedURLOptions,
16-
TransformOptions,
15+
ListBucketFilesOptions,
1716
RequestMethod,
17+
TransformOptions,
1818
)
1919
from ..utils import SyncClient, StorageException
2020

@@ -82,7 +82,7 @@ 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/authenticated" if options.get("transform") else "object"
8686
)
8787
transformation_query = urllib.parse.urlencode(options)
8888
query_string = f"/?{transformation_query}" if transformation_query else ""

storage3/types.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from dataclasses import dataclass
22
from datetime import datetime
3+
from typing import Optional, Union
34

45
import dateutil.parser
56
from typing_extensions import Literal, TypedDict
6-
from typing import Union, Optional
77

88
RequestMethod = Literal["GET", "POST", "DELETE", "PUT", "HEAD"]
99

@@ -45,5 +45,5 @@ class TransformOptions(TypedDict):
4545

4646

4747
class CreateSignedURLOptions(TypedDict):
48-
download: Optional[Union[str,bool]]
48+
download: Optional[Union[str, bool]]
4949
transform: Optional[TransformOptions]

0 commit comments

Comments
 (0)