mirror of
https://github.com/minio/minio.git
synced 2024-12-25 22:55:54 -05:00
fix: GetObjectRetention to parse in ISO8601 time format (#15809)
This commit is contained in:
parent
5c034e26bd
commit
b6b26dba87
@ -45,6 +45,10 @@ const (
|
|||||||
|
|
||||||
// RetCompliance - compliance mode.
|
// RetCompliance - compliance mode.
|
||||||
RetCompliance RetMode = "COMPLIANCE"
|
RetCompliance RetMode = "COMPLIANCE"
|
||||||
|
|
||||||
|
// RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z
|
||||||
|
iso8601TimeFormat = "2006-01-02T15:04:05.000Z" // Reply date format with millisecond precision.
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Valid - returns if retention mode is valid
|
// Valid - returns if retention mode is valid
|
||||||
@ -452,7 +456,7 @@ func GetObjectRetentionMeta(meta map[string]string) ObjectRetention {
|
|||||||
tillStr, ok = meta[AmzObjectLockRetainUntilDate]
|
tillStr, ok = meta[AmzObjectLockRetainUntilDate]
|
||||||
}
|
}
|
||||||
if ok {
|
if ok {
|
||||||
if t, e := time.Parse(time.RFC3339, tillStr); e == nil {
|
if t, e := time.Parse(iso8601TimeFormat, tillStr); e == nil {
|
||||||
retainTill = RetentionDate{t.UTC()}
|
retainTill = RetentionDate{t.UTC()}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user