Skip to content

Commit

Permalink
RGWLC: fix expiration header tag match
Browse files Browse the repository at this point in the history
Need to match key->value

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit af327f2)
  • Loading branch information
mattbenjamin authored and Prashant D committed Aug 29, 2019
1 parent c23385d commit a637386
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/rgw/rgw_lc.cc
Expand Up @@ -1536,12 +1536,21 @@ std::string s3_expiration_header(
}

if (filter.has_tags()) {
bool tag_match = true;
bool tag_match = false;
const RGWObjTags& rule_tagset = filter.get_tags();
for (auto& tag : rule_tagset.get_tags()) {
if (obj_tag_map.find(tag.first) == obj_tag_map.end()) {
tag_match = false;
break;
/* remember, S3 tags are {key,value} tuples */
auto ma1 = obj_tag_map.find(tag.first);
if ( ma1 != obj_tag_map.end()) {
if (tag.second == ma1->second) {
ldpp_dout(dpp, 10) << "tag match obj_key=" << obj_key
<< " rule_id=" << id
<< " tag=" << tag
<< " (ma=" << *ma1 << ")"
<< dendl;
tag_match = true;
break;
}
}
}
if (! tag_match)
Expand Down

0 comments on commit a637386

Please sign in to comment.