]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add minimum support for copy multipart part 5139/head
authorJavier M. Mellid <jmunhoz@igalia.com>
Mon, 13 Jul 2015 16:37:44 +0000 (18:37 +0200)
committerJavier M. Mellid <jmunhoz@igalia.com>
Tue, 14 Jul 2015 07:44:20 +0000 (09:44 +0200)
Return a NotImplemented error code, rather than NoSuchKey.

Fixes: #7817
Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
src/rgw/rgw_common.h
src/rgw/rgw_http_errors.h
src/rgw/rgw_rest_s3.cc

index 1baf17862528adfe059ccae86ef7f13e8270505d..bb45be725e67631ef56e36e5a148b947fedf6475 100644 (file)
@@ -148,6 +148,7 @@ using ceph::crypto::MD5;
 #define ERR_MALFORMED_XML        2029
 #define ERR_USER_SUSPENDED       2100
 #define ERR_INTERNAL_ERROR       2200
+#define ERR_NOT_IMPLEMENTED      2201
 
 #ifndef UINT32_MAX
 #define UINT32_MAX (0xffffffffu)
index 78776f46339bcc97873ab02db131c5786495d22a..1b8ca3623ab8d21aa65b3e9039f1ddc408b1f418 100644 (file)
@@ -56,6 +56,7 @@ const static struct rgw_http_errors RGW_HTTP_ERRORS[] = {
     { ERR_UNPROCESSABLE_ENTITY, 422, "UnprocessableEntity" },
     { ERR_LOCKED, 423, "Locked" },
     { ERR_INTERNAL_ERROR, 500, "InternalError" },
+    { ERR_NOT_IMPLEMENTED, 501, "NotImplemented" },
 };
 
 const static struct rgw_http_errors RGW_HTTP_SWIFT_ERRORS[] = {
@@ -109,6 +110,7 @@ const static struct rgw_http_status_code http_codes[] = {
   { 417, "Expectation Failed" },
   { 422, "Unprocessable Entity" },
   { 500, "Internal Server Error" },
+  { 501, "Not Implemented" },
   { 0, NULL },
 };
 
index 768766f8892cdea73c93c5cacd9178a732c3e98a..2dce3e1b46ae93bd07e60c127fcc857a564cea2d 100644 (file)
@@ -1422,6 +1422,10 @@ int RGWCopyObj_ObjStore_S3::init_dest_policy()
 
 int RGWCopyObj_ObjStore_S3::get_params()
 {
+  if (s->info.env->get("HTTP_X_AMZ_COPY_SOURCE_RANGE")) {
+    return -ERR_NOT_IMPLEMENTED;
+  }
+
   if_mod = s->info.env->get("HTTP_X_AMZ_COPY_IF_MODIFIED_SINCE");
   if_unmod = s->info.env->get("HTTP_X_AMZ_COPY_IF_UNMODIFIED_SINCE");
   if_match = s->info.env->get("HTTP_X_AMZ_COPY_IF_MATCH");