Skip to content

Commit

Permalink
policy: Removing a bucket policy should return an error (#1609)
Browse files Browse the repository at this point in the history
Currently removing a policy from bucket does not return an error for any
error, such as AccessDenied.

This commit fixes this behavior.
  • Loading branch information
vadmeste authored Jan 14, 2022
1 parent cb21d7d commit 88cce13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api-bucket-policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ func (c *Client) removeBucketPolicy(ctx context.Context, bucketName string) erro
if err != nil {
return err
}

if resp.StatusCode != http.StatusNoContent {
return httpRespToErrorResponse(resp, bucketName, "")
}

return nil
}

Expand Down

0 comments on commit 88cce13

Please sign in to comment.