mirror of
https://github.com/minio/minio.git
synced 2025-11-23 11:07:50 -05:00
Lifecycle: Accept empty <Filter> tag in XML documents (#12039)
Follow S3 to accept an empty filter tag inside an XML document. <Filter> needs to be specified but it doesn't have to contain any other XML tags inside it.
This commit is contained in:
@@ -86,12 +86,18 @@ func TestParseAndValidateLifecycleConfig(t *testing.T) {
|
||||
expectedParsingErr: nil,
|
||||
expectedValidationErr: errXMLNotWellFormed,
|
||||
},
|
||||
// Legitimate lifecycle
|
||||
// Lifecycle with the deprecated Prefix tag
|
||||
{
|
||||
inputConfig: `<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Rule><ID>rule</ID><Prefix /><Status>Enabled</Status><Expiration><Days>1</Days></Expiration></Rule></LifecycleConfiguration>`,
|
||||
expectedParsingErr: nil,
|
||||
expectedValidationErr: nil,
|
||||
},
|
||||
// Lifecycle with empty Filter tag
|
||||
{
|
||||
inputConfig: `<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Rule><ID>rule</ID><Filter></Filter><Status>Enabled</Status><Expiration><Days>1</Days></Expiration></Rule></LifecycleConfiguration>`,
|
||||
expectedParsingErr: nil,
|
||||
expectedValidationErr: nil,
|
||||
},
|
||||
}
|
||||
|
||||
for i, tc := range testCases {
|
||||
|
||||
Reference in New Issue
Block a user