From ec9da5b9fa2f2d873f29242b1a4da390a748758a Mon Sep 17 00:00:00 2001 From: imtzw Date: Tue, 27 Jun 2023 09:18:09 +0800 Subject: [PATCH] rgw: remove useless op ret assign in op rgwsetbucketwebsite_objstore_s3 and rgwputcors_objstore_s3 get_param trys to assign op_ret which will be overwritten by return value. use this to be assigned value as the return value will result in a same http response because in rgw_common rgw_http_s3_errors will translate them into the same. Signed-off-by: imtzw --- src/rgw/rgw_rest_s3.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index d777b52d7f2..468d5ce51b8 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -2270,11 +2270,10 @@ int RGWSetBucketWebsite_ObjStore_S3::get_params(optional_yield y) << max_num << " rules, request website routing rules num: " << routing_rules_num << dendl; - op_ret = -ERR_INVALID_WEBSITE_ROUTING_RULES_ERROR; s->err.message = std::to_string(routing_rules_num) +" routing rules provided, the number of routing rules in a website configuration is limited to " + std::to_string(max_num) + "."; - return -ERR_INVALID_REQUEST; + return -ERR_INVALID_WEBSITE_ROUTING_RULES_ERROR; } return 0; @@ -3716,10 +3715,9 @@ int RGWPutCORS_ObjStore_S3::get_params(optional_yield y) << max_num << " rules, request cors rules num: " << cors_rules_num << dendl; - op_ret = -ERR_INVALID_CORS_RULES_ERROR; s->err.message = "The number of CORS rules should not exceed allowed limit of " + std::to_string(max_num) + " rules."; - return -ERR_INVALID_REQUEST; + return -ERR_INVALID_CORS_RULES_ERROR; } // forward bucket cors requests to meta master zone -- 2.47.3