]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: the error code returned by rgw is different from amz s3 when 27122/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:30:31 +0000 (14:30 +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_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 4aafccaf499d99c31ae222ae72f08465869f6e1a..65f1effbfddbcbd1a1583a078e8f41458d9829a5 100644 (file)
@@ -93,6 +93,7 @@ rgw_http_errors rgw_http_s3_errors({
     { ERR_NO_SUCH_BUCKET_POLICY, {404, "NoSuchBucketPolicy"}},
     { ERR_NO_SUCH_USER, {404, "NoSuchUser"}},
     { ERR_NO_ROLE_FOUND, {404, "NoSuchEntity"}},
+    { ERR_NO_CORS_FOUND, {404, "NoSuchCORSConfiguration"}},
     { ERR_NO_SUCH_SUBUSER, {404, "NoSuchSubUser"}},
     { ERR_METHOD_NOT_ALLOWED, {405, "MethodNotAllowed" }},
     { ETIMEDOUT, {408, "RequestTimeout" }},
index 7afee9f7087e5e89cbdba98f928f5cf2a1683746..a388a65871d888aff97949e343dd9fbd8799963e 100644 (file)
@@ -219,6 +219,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 0565fce5e05f3d41f4004237e47bbb7791403fe4..fac40027de2802baaef8787f304b7bba662be28a 100644 (file)
@@ -5174,7 +5174,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;
   }
 }