From: Jeegn Chen Date: Tue, 22 May 2018 05:16:45 +0000 (+0800) Subject: rgw: reject invalid methods in validate_cors_rule_method X-Git-Tag: v14.0.1~934^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22145%2Fhead;p=ceph.git rgw: reject invalid methods in validate_cors_rule_method Fixes: http://tracker.ceph.com/issues/24223 Signed-off-by: Jeegn Chen --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 789999e8695e..88a156862c0a 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -984,7 +984,7 @@ static bool validate_cors_rule_method(RGWCORSRule *rule, const char *req_meth) { else if (strcmp(req_meth, "DELETE") == 0) flags = RGW_CORS_DELETE; else if (strcmp(req_meth, "HEAD") == 0) flags = RGW_CORS_HEAD; - if ((rule->get_allowed_methods() & flags) == flags) { + if (rule->get_allowed_methods() & flags) { dout(10) << "Method " << req_meth << " is supported" << dendl; } else { dout(5) << "Method " << req_meth << " is not supported" << dendl;