]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pacific: rgw: an empty tagset is allowed by S3 49809/head
authorVolker Theile <vtheile@suse.com>
Fri, 20 Jan 2023 16:02:01 +0000 (17:02 +0100)
committerVolker Theile <vtheile@suse.com>
Fri, 20 Jan 2023 16:13:19 +0000 (17:13 +0100)
Fixes: https://tracker.ceph.com/issues/58470
Signed-off-by: Volker Theile <vtheile@suse.com>
Signed-off-by: Liu Lan <liulan_yewu@cmss.chinamobile.com>
(cherry picked from commit 3ae77c51a74f441d1e9a078fc7bf61103f783b5e)

src/rgw/rgw_tag.cc
src/rgw/rgw_tag_s3.cc

index e60a265e7384e3e08f9047e59dd1ca92f0d89a68..b9ca88f04ac6c2da7a6b36eb50dde0c9c9654994 100644 (file)
@@ -32,6 +32,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 2c352c592030254bf6f076bfe2a47022ab953df9..494e6b8744f00c26b3794b86603967bb704ba39c 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();