mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
bucket-policy: Delete policy should remove policy properly. (#1456)
This commit is contained in:
parent
afd59c45dc
commit
ac7a7cec20
@ -101,6 +101,9 @@ func removeBucketPolicy(bucket string) error {
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := os.Remove(bucketPolicyFile); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,6 +350,15 @@ func (s *MyAPISuite) TestBucketPolicy(c *C) {
|
|||||||
response, err = client.Do(request)
|
response, err = client.Do(request)
|
||||||
c.Assert(err, IsNil)
|
c.Assert(err, IsNil)
|
||||||
c.Assert(response.StatusCode, Equals, http.StatusNoContent)
|
c.Assert(response.StatusCode, Equals, http.StatusNoContent)
|
||||||
|
|
||||||
|
// Verify if the policy was indeed deleted.
|
||||||
|
request, err = s.newRequest("GET", testAPIFSCacheServer.URL+"/policybucket?policy", 0, nil)
|
||||||
|
c.Assert(err, IsNil)
|
||||||
|
|
||||||
|
client = http.Client{}
|
||||||
|
response, err = client.Do(request)
|
||||||
|
c.Assert(err, IsNil)
|
||||||
|
c.Assert(response.StatusCode, Equals, http.StatusNotFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MyAPISuite) TestDeleteBucket(c *C) {
|
func (s *MyAPISuite) TestDeleteBucket(c *C) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user