]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: the error code returned by rgw is different from amz s3 when 27123/head
authorashitakasam <694240887@qq.com>
Mon, 20 Aug 2018 08:49:52 +0000 (16:49 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 22 Mar 2019 13:36:10 +0000 (14:36 +0100)
getting cors from the bucket without cors configuration

Fixes: http://tracker.ceph.com/issues/26964
Signed-off-by: ashitakasam <694240887@qq.com>
(cherry picked from commit 009a67fe4d09c4904bb9711f9bd4c60f353199ec)

Conflicts:
src/rgw/rgw_common.cc
- luminous has no ERR_NO_ROLE_FOUND
src/rgw/rgw_op.cc
- mimic uses dout(2) instead of ldpp_dout(this, 2)

src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_op.cc

index 0a31d5d34141d53a6cf6113b558a61f11124fcbf..6be06af322b2fb210b6c25921eab48fd2d755fd7 100644 (file)
@@ -92,6 +92,7 @@ rgw_http_errors rgw_http_s3_errors({
     { ERR_NO_SUCH_LC, {404, "NoSuchLifecycleConfiguration"}},
     { ERR_NO_SUCH_BUCKET_POLICY, {404, "NoSuchBucketPolicy"}},
     { ERR_NO_SUCH_USER, {404, "NoSuchUser"}},
+    { ERR_NO_CORS_FOUND, {404, "NoSuchCORSConfiguration"}},
     { ERR_NO_SUCH_SUBUSER, {404, "NoSuchSubUser"}},
     { ERR_NO_SUCH_CORS_CONFIGURATION, {404, "NoSuchCORSConfiguration"}},
     { ERR_METHOD_NOT_ALLOWED, {405, "MethodNotAllowed" }},
index 72f42c53f1b22686a6f3fcb144e2ace4192358f9..226d0dc742d8d7f7cb2367242a68a1d445057fe8 100644 (file)
@@ -220,6 +220,7 @@ using ceph::crypto::MD5;
 #define ERR_ZONEGROUP_DEFAULT_PLACEMENT_MISCONFIGURATION 2213
 #define ERR_INVALID_ENCRYPTION_ALGORITHM                 2214
 #define ERR_INVALID_CORS_RULES_ERROR                     2215
+#define ERR_NO_CORS_FOUND        2216
 
 #define ERR_BUSY_RESHARDING      2300
 
index f9e67c0d75d397a8f929274f8b2919db116e7b75..01f78d390bac2d3f651e0371a1848ca491a38afd 100644 (file)
@@ -5046,7 +5046,7 @@ void RGWGetCORS::execute()
 
   if (!cors_exist) {
     dout(2) << "No CORS configuration set yet for this bucket" << dendl;
-    op_ret = -ENOENT;
+    op_ret = -ERR_NO_CORS_FOUND;
     return;
   }
 }