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

Commit 2965ae7

Browse files
committed
fix: use ** to merge dicts
1 parent 4d2a73f commit 2965ae7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

storage3/_async/file_api.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,8 @@ async 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 = await self._request(
133132
"POST",
134133
f"/object/list/{self.id}",
@@ -167,13 +166,13 @@ async 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("contentType"))}
177176
_path = self._get_final_path(path)
178177

179178
return await self._request(

0 commit comments

Comments
 (0)