mirror of
https://github.com/versity/versitygw.git
synced 2026-07-19 06:22:19 +00:00
Merge pull request #2175 from SebTardif/fix/nil-panic-ownership-controls
fix: prevent index-out-of-range panic in s3proxy GetBucketOwnershipControls
This commit is contained in:
@@ -258,6 +258,9 @@ func (s *S3Proxy) GetBucketOwnershipControls(ctx context.Context, bucket string)
|
||||
if err != nil {
|
||||
return ownship, handleError(err)
|
||||
}
|
||||
if resp.OwnershipControls == nil || len(resp.OwnershipControls.Rules) == 0 {
|
||||
return ownship, s3err.GetBucketErr(s3err.ErrOwnershipControlsNotFound, bucket)
|
||||
}
|
||||
return resp.OwnershipControls.Rules[0].ObjectOwnership, nil
|
||||
}
|
||||
func (s *S3Proxy) DeleteBucketOwnershipControls(ctx context.Context, bucket string) error {
|
||||
|
||||
Reference in New Issue
Block a user