]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
fix: Revert url_decode to old behaviour
authorEmin <emin.sunacoglu@clyso.com>
Tue, 10 Jun 2025 09:03:21 +0000 (11:03 +0200)
committerCasey Bodley <cbodley@redhat.com>
Thu, 19 Jun 2025 19:00:49 +0000 (15:00 -0400)
Signed-off-by: Emin <emin.sunacoglu@clyso.com>
(cherry picked from commit c603ce719aca906d75af60e7d31bf13db09d8ec6)

src/rgw/rgw_common.cc

index b1f07d092d2d1c873ae58b78523f9e36d891d1be..f8c74e495f96d9ecea720876c365e4b32c3980c3 100644 (file)
@@ -1765,14 +1765,13 @@ std::string url_decode(const std::string_view& src_str, bool in_query)
       const char c1 = hex_to_num(*src++);
       const char c2 = hex_to_num(*src);
       if (c1 < 0 || c2 < 0) {
-        src--;
-        src--; //going back to the %
-        dest_str.push_back(*src); //add % to the target destination string
+        return std::string();
       } else {
         dest_str.push_back(c1 << 4 | c2);
       }
     }
   }
+  
   return dest_str;
 }