summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2012-10-10 12:50:11 -0700
committerYehuda Sadeh <yehuda@inktank.com>2012-10-23 10:43:09 -0700
commitfc05b634721d86386397a7c0e73a438d18236ebc (patch)
treeb58cd1dc31bae49b5a7fbb9698f117456a8b040c
parent52b78d511b78dc8aa27c161e6e57c992c0e954ac (diff)
downloadceph-fc05b634721d86386397a7c0e73a438d18236ebc.tar.gz
rgw: handle x-ignore- in POST request
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/rgw/rgw_policy_s3.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rgw/rgw_policy_s3.cc b/src/rgw/rgw_policy_s3.cc
index 7dae34325e9..05cb3469f01 100644
--- a/src/rgw/rgw_policy_s3.cc
+++ b/src/rgw/rgw_policy_s3.cc
@@ -84,8 +84,12 @@ bool RGWPolicyEnv::get_value(const string& s, string& val, map<string, bool>& ch
bool RGWPolicyEnv::match_policy_vars(map<string, bool>& policy_vars)
{
map<string, string>::iterator iter;
+ string ignore_prefix = "x-ignore-";
for (iter = vars.begin(); iter != vars.end(); ++iter) {
- if (policy_vars.count(iter->first) == 0) {
+ const string& var = iter->first;
+ if (strncasecmp(ignore_prefix.c_str(), var.c_str(), ignore_prefix.size()) == 0)
+ continue;
+ if (policy_vars.count(var) == 0) {
dout(1) << "env var missing in policy: " << iter->first << dendl;
return false;
}