Skip to content

Commit

Permalink
Added a fix for not valid status value in lifecycle configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Aayush Chouhan <[email protected]>
  • Loading branch information
achouhan09 committed Jan 7, 2025
1 parent 37154c6 commit 84a4218
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/endpoint/s3/ops/s3_put_bucket_lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ async function put_bucket_lifecycle(req) {
if (rule.Status?.length !== 1) {
dbg.error('Rule should have status', rule);
throw new S3Error(S3Error.InvalidArgument);
} else if (rule.status?.length == 1) {
if (rule.Status[0] !== "Enabled" || rule.Status[0] !== "Disabled") {
dbg.error('Rule should not have status value: ', rule.Status[0]);
throw new S3Error({ ...S3Error.MalformedXML, message: 'The XML you provided was not well-formed or did not validate against our published schema'});
}
}
current_rule.status = rule.Status[0];

Expand Down

0 comments on commit 84a4218

Please sign in to comment.