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

Commit 1217cba

Browse files
committed
chore: build sync
1 parent 66f088e commit 1217cba

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from ..constants import DEFAULT_FILE_OPTIONS, DEFAULT_SEARCH_OPTIONS
1010
from ..types import BaseBucket, ListBucketFilesOptions, RequestMethod
11-
from ..utils import StorageException, SyncClient
11+
from ..utils import SyncClient, StorageException
1212

1313
__all__ = ["SyncBucket"]
1414

@@ -126,9 +126,8 @@ def list(
126126
Search options, including `limit`, `offset`, and `sortBy`.
127127
"""
128128
extra_options = options or {}
129-
body = dict(DEFAULT_SEARCH_OPTIONS, **extra_options)
130129
extra_headers = {"Content-Type": "application/json"}
131-
body["prefix"] = path or ""
130+
body = {**DEFAULT_SEARCH_OPTIONS, **extra_options, "prefix": path or ""}
132131
response = self._request(
133132
"POST",
134133
f"/object/list/{self.id}",
@@ -167,13 +166,13 @@ def upload(
167166
file
168167
The File object to be stored in the bucket. or a async generator of chunks
169168
file_options
170-
HTTP headers. For example `cacheControl`
169+
HTTP headers. For example `cache-control`
171170
"""
172171
if file_options is None:
173172
file_options = {}
174-
headers = dict(self._client.headers, **DEFAULT_FILE_OPTIONS, **file_options)
173+
headers = {**self._client.headers, **DEFAULT_FILE_OPTIONS, **file_options}
175174
filename = path.rsplit("/", maxsplit=1)[-1]
176-
files = {"file": (filename, open(file, "rb"), headers["contentType"])}
175+
files = {"file": (filename, open(file, "rb"), headers.pop("content-type"))}
177176
_path = self._get_final_path(path)
178177

179178
return self._request(

0 commit comments

Comments
 (0)