From: Nick Janus Date: Wed, 22 Nov 2017 18:29:00 +0000 (-0500) Subject: rgw: Fix S3 compatibility bug when CORS is not found X-Git-Tag: v12.2.4~16^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3330f587f7e56a40f06c378b24770e1af60f09db;p=ceph.git rgw: Fix S3 compatibility bug when CORS is not found Signed-off-by: Nick Janus --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index d10577ef455..4ef07bb7013 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -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" }}, diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 6146d1cb33c..059a7554739 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -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 diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index aa5b525d04d..3312f9c71f7 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -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); }