From: Liu Lan Date: Thu, 10 Dec 2020 09:00:56 +0000 (+0800) Subject: rgw: an empty tagset is allowed by S3 X-Git-Tag: v17.1.0~85^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ae77c51a74f441d1e9a078fc7bf61103f783b5e;p=ceph.git rgw: an empty tagset is allowed by S3 Signed-off-by: Liu Lan --- diff --git a/src/rgw/rgw_tag.cc b/src/rgw/rgw_tag.cc index f43a18248685..6f030c3577cc 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 b03607f73a7e..b54265f90bff 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();