From b164ad893ee82a3cba6cffc113fe3fced4170a02 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Fri, 11 Oct 2024 15:46:30 -0400 Subject: rgw_cksum: don't display nil checksums in get-object-attributes (parts) Signed-off-by: Matt Benjamin --- src/rgw/rgw_rest_s3.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/rgw/rgw_rest_s3.cc') 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); -- cgit v1.2.3