]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: an empty tagset is allowed by S3 38532/head
authorLiu Lan <liulan@cmss.chinamobile.com>
Thu, 10 Dec 2020 09:00:56 +0000 (17:00 +0800)
committerLiu Lan <liulan@cmss.chinamobile.com>
Mon, 18 Jan 2021 06:24:55 +0000 (14:24 +0800)
Signed-off-by: Liu Lan <liulan_yewu@cmss.chinamobile.com>
src/rgw/rgw_tag.cc
src/rgw/rgw_tag_s3.cc

index f43a1824868562dc226eaf411cd031dcde1d8a31..6f030c3577ccb73c131f501c2ffa7997221ae9ae 100644 (file)
@@ -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 <string> kvs;
   boost::split(kvs, input, boost::is_any_of("&"));
index b03607f73a7e68976e7ad6160e2f39cbc7ce0910..b54265f90bff5065a1a3e2fd640c604cec65d02d 100644 (file)
@@ -30,7 +30,8 @@ void RGWObjTagEntry_S3::dump_xml(Formatter *f) const {
 void RGWObjTagSet_S3::decode_xml(XMLObj *obj) {
   vector<RGWObjTagEntry_S3> 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();