mirror of
https://github.com/ceph/ceph
synced 2025-01-03 09:32:43 +00:00
rgw:lc return error if expiration_date is not midnight in Lifecycleconfiguration xml
According to S3, expiration_date must be midnight. Signed-off-by: Shasha Lu <lu.shasha@eisoo.com>
This commit is contained in:
parent
311373a12a
commit
45216cc64e
@ -32,7 +32,12 @@ bool LCExpiration_S3::xml_end(const char * el) {
|
||||
} else {
|
||||
date = lc_date->get_data();
|
||||
//We need return xml error according to S3
|
||||
if (boost::none == ceph::from_iso_8601(date)) {
|
||||
boost::optional<ceph::real_time> expiration_date = ceph::from_iso_8601(date);
|
||||
if (boost::none == expiration_date) {
|
||||
return false;
|
||||
}
|
||||
struct timespec expiration_time = ceph::real_clock::to_timespec(*expiration_date);
|
||||
if (expiration_time.tv_sec % (24*60*60) || expiration_time.tv_nsec) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user