]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix S3 compatibility bug when CORS is not found 27331/head
authorNick Janus <nickjanus@gmail.com>
Wed, 22 Nov 2017 18:29:00 +0000 (13:29 -0500)
committerPrashant D <pdhange@redhat.com>
Wed, 3 Apr 2019 00:27:44 +0000 (20:27 -0400)
Fixes: http://tracker.ceph.com/issues/37945
Signed-off-by: Nick Janus <nickjanus@gmail.com>
(cherry picked from commit baaf5d6a1d7232d904d9f8d39b52498fe8480453)

src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_rest_s3.cc

index d35a97eaf79ef7be12fc01f4b5460246e0a87b57..dcade32363e0a9b7be3a9826a716735f82a55773 100644 (file)
@@ -94,6 +94,7 @@ rgw_http_errors rgw_http_s3_errors({
     { ERR_NO_CORS_FOUND, {404, "NoSuchCORSConfiguration"}},
     { ERR_NO_SUCH_SUBUSER, {404, "NoSuchSubUser"}},
     { ERR_NO_SUCH_ENTITY, {404, "NoSuchEntity"}},
+    { ERR_NO_SUCH_CORS_CONFIGURATION, {404, "NoSuchCORSConfiguration"}},
     { ERR_METHOD_NOT_ALLOWED, {405, "MethodNotAllowed" }},
     { ETIMEDOUT, {408, "RequestTimeout" }},
     { EEXIST, {409, "BucketAlreadyExists" }},
index 6dc8ef5f56516850558b3814c722f6ea32925491..d558b6bdc2e426ffa7bd4d89fbb3535fbc636c06 100644 (file)
@@ -207,6 +207,7 @@ using ceph::crypto::MD5;
 #define ERR_NO_SUCH_USER         2042
 #define ERR_NO_SUCH_SUBUSER      2043
 #define ERR_MFA_REQUIRED         2044
+#define ERR_NO_SUCH_CORS_CONFIGURATION 2045
 #define ERR_USER_SUSPENDED       2100
 #define ERR_INTERNAL_ERROR       2200
 #define ERR_NOT_IMPLEMENTED      2201
index be1c3fe6c430f22dc1807b8b2a06ca92b4c9bf49..77fa96415b816bb6c7cb0464eba3010760a07e09 100644 (file)
@@ -2413,7 +2413,7 @@ void RGWGetCORS_ObjStore_S3::send_response()
 {
   if (op_ret) {
     if (op_ret == -ENOENT)
-      set_req_state_err(s, ERR_NOT_FOUND);
+      set_req_state_err(s, ERR_NO_SUCH_CORS_CONFIGURATION);
     else
       set_req_state_err(s, op_ret);
   }