]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: handle x-ignore- in POST request
authorYehuda Sadeh <yehuda@inktank.com>
Wed, 10 Oct 2012 19:50:11 +0000 (12:50 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 23 Oct 2012 17:43:09 +0000 (10:43 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_policy_s3.cc

index 7dae34325e914520f8b24a27df222529abc337e9..05cb3469f017c990ae3b2cc6fe12d5ec7bc59314 100644 (file)
@@ -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;
     }