]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: enforce presence of at least one file to upload in RGWFormPost.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Wed, 21 Sep 2016 13:42:09 +0000 (15:42 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 24 Apr 2017 15:32:15 +0000 (17:32 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_rest_swift.cc

index cd6c69decdbc5765fdbe8c74eecc46bf7e5b3ad9..49655cbea31846cb5d533ebc8dd45c6bf727500f 100644 (file)
@@ -1847,6 +1847,11 @@ int RGWFormPost::get_params()
     }
   } while (! stream_done);
 
+  if (! current_data_part) {
+    err_msg = "FormPost: no files to process";
+    return -EINVAL;
+  }
+
   if (! is_non_expired()) {
     err_msg = "FormPost: Form Expired";
     return -EACCES;
@@ -1857,7 +1862,7 @@ int RGWFormPost::get_params()
     return -EACCES;
   }
 
-  return ! current_data_part ? -EINVAL : 0;
+  return 0;
 }
 
 std::string RGWFormPost::get_current_filename() const