]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix S3 compatibility bug when CORS is not found 19104/head
authorNick Janus <nickjanus@gmail.com>
Wed, 22 Nov 2017 18:29:00 +0000 (13:29 -0500)
committerNick Janus <nickjanus@gmail.com>
Wed, 22 Nov 2017 18:32:38 +0000 (13:32 -0500)
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 d10577ef455cb19900b9b6aabcfb019254901ef6..4ef07bb7013e5620ca5df14e038f5bd24d0be4a6 100644 (file)
@@ -94,6 +94,7 @@ rgw_http_errors rgw_http_s3_errors({
     { ERR_NO_SUCH_BUCKET_POLICY, {404, "NoSuchBucketPolicy"}},
     { ERR_NO_SUCH_USER, {404, "NoSuchUser"}},
     { ERR_NO_SUCH_SUBUSER, {404, "NoSuchSubUser"}},
+    { ERR_NO_SUCH_CORS_CONFIGURATION, {404, "NoSuchCORSConfiguration"}},
     { ERR_METHOD_NOT_ALLOWED, {405, "MethodNotAllowed" }},
     { ETIMEDOUT, {408, "RequestTimeout" }},
     { EEXIST, {409, "BucketAlreadyExists" }},
index 6146d1cb33cc720d5a7cde51f6d0e069355c30ad..059a755473929cdc6041b18ae7b431dd36d77119 100644 (file)
@@ -201,6 +201,7 @@ using ceph::crypto::MD5;
 #define ERR_NO_SUCH_LC           2041
 #define ERR_NO_SUCH_USER         2042
 #define ERR_NO_SUCH_SUBUSER      2043
+#define ERR_NO_SUCH_CORS_CONFIGURATION 2044
 #define ERR_USER_SUSPENDED       2100
 #define ERR_INTERNAL_ERROR       2200
 #define ERR_NOT_IMPLEMENTED      2201
index aa5b525d04da84cf73837af223f094fa94b0e9c9..3312f9c71f708d8302765f0129b80179aef8d658 100644 (file)
@@ -2275,7 +2275,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);
   }