From: zhang Shaowen Date: Thu, 26 Sep 2019 07:40:18 +0000 (+0800) Subject: rgw: filter prefix should be used when generating expiration header. The rule prefix... X-Git-Tag: v16.1.0~1205^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=25dd43ab75e431d0b2b4bb62fd54a0bfc4dc78be;p=ceph.git rgw: filter prefix should be used when generating expiration header. The rule prefix is set with old version lifecycle configure. While filter prefix is the latest version which AWS suggests users use. Fixes: https://tracker.ceph.com/issues/45144 Signed-off-by: zhang Shaowen --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 18cb5aa84ba8..b813bfcd80d5 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -1580,8 +1580,8 @@ std::string s3_expiration_header( for (const auto& ri : rule_map) { const auto& rule = ri.second; auto& id = rule.get_id(); - auto& prefix = rule.get_prefix(); auto& filter = rule.get_filter(); + auto& prefix = filter.has_prefix() ? filter.get_prefix(): rule.get_prefix(); auto& expiration = rule.get_expiration(); auto& noncur_expiration = rule.get_noncur_expiration(); @@ -1611,7 +1611,7 @@ std::string s3_expiration_header( if(! prefix.empty()) { if (! boost::starts_with(obj_key.name, prefix)) - continue; + continue; } if (filter.has_tags()) {