From 3ae77c51a74f441d1e9a078fc7bf61103f783b5e Mon Sep 17 00:00:00 2001 From: Liu Lan Date: Thu, 10 Dec 2020 17:00:56 +0800 Subject: [PATCH] rgw: an empty tagset is allowed by S3 Signed-off-by: Liu Lan --- src/rgw/rgw_tag.cc | 3 +++ src/rgw/rgw_tag_s3.cc | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_tag.cc b/src/rgw/rgw_tag.cc index f43a182486856..6f030c3577ccb 100644 --- a/src/rgw/rgw_tag.cc +++ b/src/rgw/rgw_tag.cc @@ -35,6 +35,9 @@ int RGWObjTags::check_and_add_tag(const string&key, const string& val){ } int RGWObjTags::set_from_string(const string& input){ + if (input.empty()) { + return 0; + } int ret=0; vector kvs; boost::split(kvs, input, boost::is_any_of("&")); diff --git a/src/rgw/rgw_tag_s3.cc b/src/rgw/rgw_tag_s3.cc index b03607f73a7e6..b54265f90bff5 100644 --- a/src/rgw/rgw_tag_s3.cc +++ b/src/rgw/rgw_tag_s3.cc @@ -30,7 +30,8 @@ void RGWObjTagEntry_S3::dump_xml(Formatter *f) const { void RGWObjTagSet_S3::decode_xml(XMLObj *obj) { vector entries; - RGWXMLDecoder::decode_xml("Tag", entries, obj, true); + bool mandatory{false}; + RGWXMLDecoder::decode_xml("Tag", entries, obj, mandatory); for (auto& entry : entries) { const std::string& key = entry.get_key(); -- 2.47.3