summaryrefslogtreecommitdiff
path: root/src/rgw/rgw_op.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rgw/rgw_op.cc')
-rw-r--r--src/rgw/rgw_op.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc
index 97f62874ffb..15e51712ca3 100644
--- a/src/rgw/rgw_op.cc
+++ b/src/rgw/rgw_op.cc
@@ -2043,7 +2043,7 @@ int RGWOptionsCORS::validate_cors_request(RGWCORSConfiguration *cc) {
}
if (!validate_cors_rule_method(rule, req_meth)) {
- return -ENOTSUP;
+ return -ENOENT;
}
return 0;
}
@@ -2059,12 +2059,7 @@ void RGWOptionsCORS::execute()
dout(0) <<
"Preflight request without mandatory Origin header"
<< dendl;
- ret = -EACCES;
- return;
- }
- if (!cors_exist) {
- dout(2) << "No CORS configuration set yet for this bucket" << dendl;
- ret = -ENOENT;
+ ret = -EINVAL;
return;
}
req_meth = s->info.env->get("HTTP_ACCESS_CONTROL_REQUEST_METHOD");
@@ -2072,7 +2067,12 @@ void RGWOptionsCORS::execute()
dout(0) <<
"Preflight request without mandatory Access-control-request-method header"
<< dendl;
- ret = -EACCES;
+ ret = -EINVAL;
+ return;
+ }
+ if (!cors_exist) {
+ dout(2) << "No CORS configuration set yet for this bucket" << dendl;
+ ret = -ENOENT;
return;
}
req_hdrs = s->info.env->get("HTTP_ACCESS_CONTROL_ALLOW_HEADERS");