]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix S3 compatibility bug when CORS is not found 25999/head
authorNick Janus <nickjanus@gmail.com>
Wed, 22 Nov 2017 18:29:00 +0000 (13:29 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 16 Jan 2019 22:05:51 +0000 (17:05 -0500)
Fixes: http://tracker.ceph.com/issues/37945
Signed-off-by: Nick Janus <nickjanus@gmail.com>
src/rgw/rgw_common.cc
src/rgw/rgw_common.h
src/rgw/rgw_rest_s3.cc

index a23eb418edd0a1ca835078a63c2cc8da601402ab..bc43ded343c825907a1958554172a21f7dafda09 100644 (file)
@@ -97,6 +97,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 146074540877516dde5c326f02dc6826ff61a776..dabafe9c1e5e9b8d30b9d1c5cf6c3de6630861e0 100644 (file)
@@ -204,6 +204,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 7708d328252cc36fdbd8451ff505ee1871447382..4617b08536e5260e4ce65e54713808afc903b496 100644 (file)
@@ -2362,7 +2362,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);
   }