mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
Merge pull request #117 from harshavardhana/pr_out_fix_build_issue
This commit is contained in:
commit
dd5380fc86
@ -127,13 +127,17 @@ func (server *minioApi) putBucketHandler(w http.ResponseWriter, req *http.Reques
|
|||||||
vars := mux.Vars(req)
|
vars := mux.Vars(req)
|
||||||
bucket := vars["bucket"]
|
bucket := vars["bucket"]
|
||||||
err := server.storage.StoreBucket(bucket)
|
err := server.storage.StoreBucket(bucket)
|
||||||
if err != nil {
|
switch err := err.(type) {
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
case nil:
|
||||||
w.Write([]byte(err.Error()))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
w.Header().Set("Server", "Minio")
|
w.Header().Set("Server", "Minio")
|
||||||
w.Header().Set("Connection", "close")
|
w.Header().Set("Connection", "close")
|
||||||
|
case mstorage.BucketNameInvalid:
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
w.Write([]byte(err.Error()))
|
||||||
|
case mstorage.BucketExists:
|
||||||
|
w.WriteHeader(http.StatusConflict)
|
||||||
|
w.Write([]byte(err.Error()))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (server *minioApi) getObjectHandler(w http.ResponseWriter, req *http.Request) {
|
func (server *minioApi) getObjectHandler(w http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -241,13 +241,10 @@ func (s *MySuite) TestPutObject(c *C) {
|
|||||||
testServer := httptest.NewServer(httpHandler)
|
testServer := httptest.NewServer(httpHandler)
|
||||||
defer testServer.Close()
|
defer testServer.Close()
|
||||||
|
|
||||||
err := storage.StoreBucket("bucket")
|
|
||||||
c.Assert(err, IsNil)
|
|
||||||
|
|
||||||
objects, isTruncated, err := storage.ListObjects("bucket", "", 1000)
|
objects, isTruncated, err := storage.ListObjects("bucket", "", 1000)
|
||||||
c.Assert(len(objects), Equals, 0)
|
c.Assert(len(objects), Equals, 0)
|
||||||
c.Assert(isTruncated, Equals, false)
|
c.Assert(isTruncated, Equals, false)
|
||||||
c.Assert(err, IsNil)
|
c.Assert(err, Not(IsNil))
|
||||||
|
|
||||||
date1 := time.Now()
|
date1 := time.Now()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user