]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: url encode exposed bucket 5730/head
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 30 Jul 2015 21:47:15 +0000 (14:47 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 31 Aug 2015 21:08:52 +0000 (14:08 -0700)
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 9e2338f6dd3fdd1d0bf6d0f10179926b8b7f6d51..cee6b6a8bce681f1e6030149836efd6334626275 100644 (file)
@@ -294,8 +294,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());
+    }
   }
 }