]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: aws-chunked need not supply any content-length
authorMatt Benjamin <mbenjamin@redhat.com>
Sun, 18 May 2025 01:02:34 +0000 (21:02 -0400)
committerThomas Serlin <tserlin@redhat.com>
Mon, 22 Sep 2025 19:18:18 +0000 (15:18 -0400)
The updated logic for aws chunked handling (2024) appears sufficient
to handle the cases produced by aws-sdk-go-v2.

Note that https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
states that "For all requests, you must include the
x-amz-decoded-content-length header, specifying the size of the object in
bytes." (accessed 5/17/2025) (but now we do not enforce it).

Reported (with reproducer!) by: Fred Heinecke.

Fixes: https://tracker.ceph.com/issues/71183
Resolves: rhbz#2392604

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 0624dbbc3bd10f816262d5e096fa7b147231b2fb)

src/rgw/rgw_auth_s3.cc
src/rgw/rgw_op.cc

index 9d7f6ec1f485a76e08d32c9b324298f51fd1b231..abac5c1b34370931671525d8d12a6f34a07d2c6d 100644 (file)
@@ -1482,9 +1482,7 @@ void AWSv4ComplMulti::modify_request_state(const DoutPrefixProvider* dpp, req_st
   const char* const decoded_length = \
     s_rw->info.env->get("HTTP_X_AMZ_DECODED_CONTENT_LENGTH");
 
-  if (!decoded_length) {
-    throw -EINVAL;
-  } else {
+  if (decoded_length) {
     /* XXXX oh my, we forget the original content length */
     s_rw->length = decoded_length;
     s_rw->content_length = parse_content_length(decoded_length);
index 1c11fd5382a812af0d056c8558145f736b75cebb..15f241ffc1905278568c7f5092d89a1eb9bb82da 100644 (file)
@@ -7026,7 +7026,7 @@ void RGWCompleteMultipart::execute(optional_yield y)
     fmt::format("INFO: {}->get_multipart_upload for obj {}, {} cksum_type {}",
                s->bucket->get_name(),
                s->object->get_name(), upload_id,
-               (!!upload) ? to_string(upload->cksum_type) : 0)
+               (!!upload) ? to_string(upload->cksum_type) : "nil")
                << dendl;
 
   rgw_placement_rule* dest_placement;