summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Benjamin <mbenjamin@redhat.com>2024-10-11 21:46:30 +0200
committerMatt Benjamin <mbenjamin@redhat.com>2025-01-08 01:16:57 +0100
commitb164ad893ee82a3cba6cffc113fe3fced4170a02 (patch)
treed6a3e98b13f96c7a22e9b20c74bc8ecbce2315d8 /src
parentrgw: GetObjectAttributes iam policy policy hooks (diff)
downloadceph-b164ad893ee82a3cba6cffc113fe3fced4170a02.tar.xz
ceph-b164ad893ee82a3cba6cffc113fe3fced4170a02.zip
rgw_cksum: don't display nil checksums in get-object-attributes (parts)
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/rgw/rgw_rest_s3.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc
index 20569f7ecc9..da02c5a6256 100644
--- a/src/rgw/rgw_rest_s3.cc
+++ b/src/rgw/rgw_rest_s3.cc
@@ -3938,7 +3938,9 @@ void RGWGetObjAttrs_ObjStore_S3::send_response()
s->formatter->open_object_section("Part");
s->formatter->dump_int("PartNumber", part.part_number);
s->formatter->dump_unsigned("Size", part.part_size);
- s->formatter->dump_string(part.cksum.element_name(), part.cksum.to_armor());
+ if (part.cksum.type != rgw::cksum::Type::none) {
+ s->formatter->dump_string(part.cksum.element_name(), part.cksum.to_armor());
+ }
s->formatter->close_section(); /* Part */
return 0;
}, s->yield);