From 8e34c65e3f59adb0ed549ad7ea394872c6e4248f Mon Sep 17 00:00:00 2001 From: Jeegn Chen Date: Tue, 22 May 2018 13:16:45 +0800 Subject: [PATCH] rgw: reject invalid methods in validate_cors_rule_method Fixes: http://tracker.ceph.com/issues/24223 Signed-off-by: Jeegn Chen --- src/rgw/rgw_op.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3