From: Casey Bodley Date: Tue, 2 Nov 2021 18:18:31 +0000 (-0400) Subject: rgw: fix ListBucketMultiparts response with common prefixes X-Git-Tag: v17.1.0~525^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3860b366246b14e0844cb5eef38b5e47ec85412;p=ceph.git rgw: fix ListBucketMultiparts response with common prefixes see documentation and examples in https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html that use Prefix directly Fixes: https://tracker.ceph.com/issues/47527 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 73f3ed5729a3..f1786351a692 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -3876,7 +3876,7 @@ void RGWListBucketMultiparts_ObjStore_S3::send_response() s->formatter->dump_string("Tenant", s->bucket_tenant); s->formatter->dump_string("Bucket", s->bucket_name); if (!prefix.empty()) - s->formatter->dump_string("ListMultipartUploadsResult.Prefix", prefix); + s->formatter->dump_string("Prefix", prefix); if (!marker_key.empty()) s->formatter->dump_string("KeyMarker", marker_key); if (!marker_upload_id.empty()) @@ -3911,10 +3911,9 @@ void RGWListBucketMultiparts_ObjStore_S3::send_response() s->formatter->open_array_section("CommonPrefixes"); for (const auto& kv : common_prefixes) { if (encode_url) { - s->formatter->dump_string("CommonPrefixes.Prefix", - url_encode(kv.first, false)); + s->formatter->dump_string("Prefix", url_encode(kv.first, false)); } else { - s->formatter->dump_string("CommonPrefixes.Prefix", kv.first); + s->formatter->dump_string("Prefix", kv.first); } } s->formatter->close_section();