From 08fbc9daf466ace29973b221792816af65683889 Mon Sep 17 00:00:00 2001 From: Or Friedmann Date: Tue, 26 Nov 2019 15:34:29 +0200 Subject: [PATCH] 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 --- src/rgw/rgw_lc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 42062af0877b5..9470b1e7b783d 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)); } } -- 2.39.5