Skip to content

Commit

Permalink
support additional headers in upload
Browse files Browse the repository at this point in the history
  • Loading branch information
dbernaciak committed Sep 12, 2024
1 parent 1f7e5de commit a44b9fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py_src/fusion/fusion_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,7 @@ async def _meth(url: Any, kw: Any) -> None:
headers[k] = v

lpath.seek(0)
kw = self.kwargs.copy()
kw.update({"headers": headers})

kw_op = self.kwargs.copy()
if "File-Name" in headers: # noqa: SIM102
kw_op.setdefault("headers", {})
Expand All @@ -752,6 +751,8 @@ async def _meth(url: Any, kw: Any) -> None:
headers["Digest"] = "SHA-256=" + base64.b64encode(hash_sha256.digest()).decode()
kw = self.kwargs.copy()
kw.update({"headers": headers})
if additional_headers:
kw["headers"].update(additional_headers)
sync(self.loop, _finish_operation, operation_id, kw)

def put( # noqa: PLR0913
Expand Down

0 comments on commit a44b9fc

Please sign in to comment.