]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: url encode exposed bucket
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 30 Jul 2015 21:47:15 +0000 (14:47 -0700)
committerKen Dreyer <kdreyer@redhat.com>
Wed, 23 Sep 2015 20:37:40 +0000 (14:37 -0600)
Fixes: #12537
Don't send the bucket name back without url encoding it.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit ad5507fe0bf72ed5bdf8353e315cc9092c740144)

src/rgw/rgw_rest.cc

index d385d6233c72254295f5cb50c7e9b904d9745378..3e6d5fb80afd7cb9f022c1120a4c69eea95f8698 100644 (file)
@@ -359,8 +359,11 @@ void dump_bucket_from_state(struct req_state *s)
 {
   int expose_bucket = g_conf->rgw_expose_bucket;
   if (expose_bucket) {
-    if (!s->bucket_name_str.empty())
-      s->cio->print("Bucket: %s\r\n", s->bucket_name_str.c_str());
+    if (!s->bucket_name_str.empty()) {
+      string b;
+      url_encode(s->bucket_name_str, b);
+      s->cio->print("Bucket: %s\r\n", b.c_str());
+    }
   }
 }