val_map[name] = val;
}
+// when sub_resources exclusive by object are added, please remember to update obj_sub_resource in RGWHTTPArgs::exist_obj_excl_sub_resource().
if ((name.compare("acl") == 0) ||
(name.compare("cors") == 0) ||
(name.compare("notification") == 0) ||
bool sub_resource_exists(const char *name) const {
return (sub_resources.find(name) != std::end(sub_resources));
}
+ bool exist_obj_excl_sub_resource() const {
+ const char* const obj_sub_resource[] = {"append", "torrent", "uploadId",
+ "partNumber", "versionId"};
+ for (int i = 0; i != std::size(obj_sub_resource); i++) {
+ if (sub_resource_exists(obj_sub_resource[i])) return true;
+ }
+ return false;
+ }
+
std::map<std::string, std::string>& get_params() {
return val_map;
}
} else {
if (s->init_state.url_bucket.empty()) {
handler = new RGWHandler_REST_Service_S3(auth_registry, enable_sts, enable_iam, enable_pubsub);
- } else if (rgw::sal::RGWObject::empty(s->object.get())) {
- handler = new RGWHandler_REST_Bucket_S3(auth_registry, enable_pubsub);
- } else {
+ } else if (!rgw::sal::RGWObject::empty(s->object.get())) {
handler = new RGWHandler_REST_Obj_S3(auth_registry);
+ } else if (s->info.args.exist_obj_excl_sub_resource()) {
+ return NULL;
+ } else {
+ handler = new RGWHandler_REST_Bucket_S3(auth_registry, enable_pubsub);
}
}