From: Or Friedmann Date: Tue, 26 Nov 2019 13:34:29 +0000 (+0200) Subject: rgw: LC expiration header should present midnight expiration date X-Git-Tag: v15.1.0~38^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=08fbc9daf466ace29973b221792816af65683889;p=ceph.git rgw: LC expiration header should present midnight expiration date According to this one the expiration date should be midnight. In obj_has_expired() it already does it but the expiration header is still not midnight Signed-off-by: Or Friedmann https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 42062af0877b..9470b1e7b783 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -1648,7 +1648,7 @@ std::string s3_expiration_header( if (rule_expiration.has_days()) { rule_expiration_date = boost::optional( - mtime + make_timespan(rule_expiration.get_days()*24*60*60)); + mtime + make_timespan(rule_expiration.get_days()*24*60*60 - ceph::real_clock::to_time_t(mtime)%(24*60*60) + 24*60*60)); } }