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: v12.2.8~28^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cc6fc60e622d119431098659412bb38d81e6db0e;p=ceph.git rgw: reject invalid methods in validate_cors_rule_method Fixes: http://tracker.ceph.com/issues/24223 Signed-off-by: Jeegn Chen (cherry picked from commit 8e34c65e3f59adb0ed549ad7ea394872c6e4248f) --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 98a6db4703f..a0f96b0c595 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -916,7 +916,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;