bypass flag: Allow object retention removal (#9677)

This commit is contained in:
Ashish Kumar Sinha 2020-05-22 22:08:58 +05:30 committed by GitHub
parent e45c90060f
commit bede525dc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -337,7 +337,7 @@ func ParseObjectRetention(reader io.Reader) (*ObjectRetention, error) {
if err := xml.NewDecoder(io.LimitReader(reader, maxObjectRetentionSize)).Decode(&ret); err != nil {
return nil, err
}
if !ret.Mode.Valid() {
if ret.Mode != "" && !ret.Mode.Valid() {
return &ret, ErrUnknownWORMModeDirective
}
@ -347,7 +347,7 @@ func ParseObjectRetention(reader io.Reader) (*ObjectRetention, error) {
return &ret, ErrPastObjectLockRetainDate
}
if ret.RetainUntilDate.Before(t) {
if !ret.RetainUntilDate.IsZero() && ret.RetainUntilDate.Before(t) {
return &ret, ErrPastObjectLockRetainDate
}