mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
lifecycle: Fix expiration header in some cases (#11565)
Expiration header was not correctly computed in case of non current versions. The behavior is fixed in this commit.
This commit is contained in:
parent
ffea6fcf09
commit
e07918abe3
@ -331,7 +331,7 @@ func (lc Lifecycle) PredictExpiryTime(obj ObjectOpts) (string, time.Time) {
|
||||
// expiration date and its associated rule ID.
|
||||
for _, rule := range lc.FilterActionableRules(obj) {
|
||||
if !rule.NoncurrentVersionExpiration.IsDaysNull() && !obj.IsLatest && obj.VersionID != "" {
|
||||
return rule.ID, ExpectedExpiryTime(time.Now(), int(rule.NoncurrentVersionExpiration.NoncurrentDays))
|
||||
return rule.ID, ExpectedExpiryTime(obj.SuccessorModTime, int(rule.NoncurrentVersionExpiration.NoncurrentDays))
|
||||
}
|
||||
|
||||
if !rule.Expiration.IsDateNull() {
|
||||
|
Loading…
Reference in New Issue
Block a user