Skip to content

Commit

Permalink
Properly handle CopyObject with content length 0
Browse files Browse the repository at this point in the history
This fixes getmoto#8592
  • Loading branch information
jeking3 authored Feb 13, 2025
1 parent c2a0d9c commit 36766d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion moto/s3/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ def setup_class(self, request: Any, full_url: str, headers: Any) -> None: # typ
and request.headers.get("Content-Encoding", "") == "aws-chunked"
and hasattr(request, "input_stream")
):
self.body = request.input_stream.getvalue()
if isinstance(request.input_stream, io.BytesIO):
self.body = request.input_stream.getvalue()
else:
self.body = request.input_stream
if (
self.request.headers.get("x-amz-content-sha256")
== "STREAMING-UNSIGNED-PAYLOAD-TRAILER"
Expand Down

0 comments on commit 36766d5

Please sign in to comment.