]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reject invalid methods in validate_cors_rule_method 22145/head
authorJeegn Chen <jeegnchen@tencent.com>
Tue, 22 May 2018 05:16:45 +0000 (13:16 +0800)
committerJeegn Chen <jeegnchen@tencent.com>
Tue, 22 May 2018 05:53:20 +0000 (13:53 +0800)
Fixes: http://tracker.ceph.com/issues/24223
Signed-off-by: Jeegn Chen <jeegnchen@tencent.com>
src/rgw/rgw_op.cc

index 789999e8695e4ed106a8c023f5e9e64081dca1f5..88a156862c0ad4576799d477bea55548519c94c7 100644 (file)
@@ -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;