]> 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 23646/head
authorashitakasam <694240887@qq.com>
Mon, 20 Aug 2018 08:49:52 +0000 (16:49 +0800)
committerashitakasam <694240887@qq.com>
Mon, 20 Aug 2018 08:49:52 +0000 (16:49 +0800)
getting cors from the bucket without cors configuration

Fixes: http://tracker.ceph.com/issues/26964
Signed-off-by: ashitakasam <694240887@qq.com>
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_op.cc

index 2e544b43418eb9f025ead4e15d3b7786e029ad03..aac2c7fe42cf6c4933a107eb9cdc9571f59d7290 100644 (file)
@@ -95,6 +95,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 b1462839d3e27f53fb1ff742060778cf6bc1ba2a..7d54e648fd47396cb24999fd9a9d17a1adf315ae 100644 (file)
@@ -218,6 +218,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 a07ba39fe76e712ec3abbd9facf81571b414c8b4..ca798909db58e5b7411381c5c7d5a79fe27e006c 100644 (file)
@@ -5205,7 +5205,7 @@ void RGWGetCORS::execute()
 
   if (!cors_exist) {
     ldpp_dout(this, 2) << "No CORS configuration set yet for this bucket" << dendl;
-    op_ret = -ENOENT;
+    op_ret = -ERR_NO_CORS_FOUND;
     return;
   }
 }