Prefix if empty skip it before IsValidBucket

This commit is contained in:
Harshavardhana 2015-01-29 01:07:37 -08:00
parent 93b47bc097
commit 82baccb8bf

View file

@ -36,8 +36,10 @@ func start(ctrlChannel <-chan string, errorChannel chan<- error) {
// Bucket Operations
func (storage *storage) ListBuckets(prefix string) ([]mstorage.BucketMetadata, error) {
if mstorage.IsValidBucket(prefix) == false {
return []mstorage.BucketMetadata{}, mstorage.BucketNameInvalid{Bucket: prefix}
if prefix != "" {
if mstorage.IsValidBucket(prefix) == false {
return []mstorage.BucketMetadata{}, mstorage.BucketNameInvalid{Bucket: prefix}
}
}
files, err := ioutil.ReadDir(storage.root)