relax validation when loading lifecycle document from the backend (#9612)

This commit is contained in:
Anis Elleuch
2020-05-18 16:33:43 +01:00
committed by GitHub
parent de9b391db3
commit 96009975d6
7 changed files with 61 additions and 31 deletions
+6
View File
@@ -72,6 +72,12 @@ func (api objectAPIHandlers) PutBucketLifecycleHandler(w http.ResponseWriter, r
return
}
// Validate the received bucket policy document
if err = bucketLifecycle.Validate(); err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
return
}
if err = objAPI.SetBucketLifecycle(ctx, bucket, bucketLifecycle); err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
return