diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-08-27 19:38:18 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-09-11 09:45:14 -0700 |
commit | 986fa92a7a1d88111ba28457160adfcfdaabc5d2 (patch) | |
tree | 5ba2f5b878124f71256ffbdb322ad49109301fc1 | |
parent | 71873aba6553492d3ad71596cefd7c841030a277 (diff) | |
download | ceph-986fa92a7a1d88111ba28457160adfcfdaabc5d2.tar.gz |
rgw: don't handle CORS if rule not found (is NULL)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_op.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 523fbdae9b2..707e7a745e7 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -503,6 +503,11 @@ bool RGWOp::generate_cors_headers(string& origin, string& method, string& header dout(2) << "No CORS configuration set yet for this bucket" << dendl; return false; } + + RGWCORSRule *rule = bucket_cors.host_name_rule(orig); + if (!rule) + return false; + const char *req_meth = s->info.env->get("HTTP_ACCESS_CONTROL_REQUEST_METHOD"); if (!req_meth) { req_meth = s->info.method; @@ -511,7 +516,6 @@ bool RGWOp::generate_cors_headers(string& origin, string& method, string& header if (req_meth) method = req_meth; - RGWCORSRule *rule = bucket_cors.host_name_rule(orig); if (!validate_cors_rule_method(rule, req_meth)) { return false; } |