]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix multi-delete query param parsing. 10188/head
authorRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 7 Jul 2016 21:14:36 +0000 (14:14 -0700)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 7 Jul 2016 21:20:34 +0000 (14:20 -0700)
Multi-delete is triggered by a query parameter on POST, but there are
multiple valid ways of representing it, and Ceph should accept ANY way
that has the query parameter set, regardless of what value or absence of
value.

This caused the RubyGem aws-sdk-v1 to break, and has been present since
multi-delete was first added in commit 0a1f4a97da, for the bobtail
release.

Fixes: http://tracker.ceph.com/issues/16618
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
(cherry picked from commit a7016e1b67e82641f0702fda4eae799e953063e6)

src/rgw/rgw_rest.cc
src/rgw/rgw_rest_s3.cc

index 826c7a9d78b9a5f09a19110c651e2494f4a51fd3..434a4c46adf4fbd5b47f7cd496374c72b0c9af46 100644 (file)
@@ -1473,7 +1473,7 @@ int RGWHandler_REST::read_permissions(RGWOp* op_obj)
   case OP_POST:
   case OP_COPY:
     /* is it a 'multi-object delete' request? */
-    if (s->info.request_params == "delete") {
+    if (s->info.args.exists("delete")) {
       only_bucket = true;
       break;
     }
index 27ae9e696ab5793254221966dafe12ea14f795ba..a153b8ba2d59ded91fc0f0a68d535bd9c4d82811 100644 (file)
@@ -2690,7 +2690,7 @@ RGWOp *RGWHandler_REST_Bucket_S3::op_delete()
 
 RGWOp *RGWHandler_REST_Bucket_S3::op_post()
 {
-  if ( s->info.request_params == "delete" ) {
+  if (s->info.args.exists("delete")) {
     return new RGWDeleteMultiObj_ObjStore_S3;
   }