mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
fs: Do not return reservedBucket names in ListBuckets() (#3754)
Make sure to skip reserved bucket names in `ListBuckets()` current code didn't skip this properly and also generalize this behavior for both XL and FS.
This commit is contained in:
@@ -161,10 +161,6 @@ func (web *webAPIHandlers) ListBuckets(r *http.Request, args *WebGenericArgs, re
|
||||
return toJSONError(err)
|
||||
}
|
||||
for _, bucket := range buckets {
|
||||
if bucket.Name == path.Base(reservedBucket) {
|
||||
continue
|
||||
}
|
||||
|
||||
reply.Buckets = append(reply.Buckets, WebBucketInfo{
|
||||
Name: bucket.Name,
|
||||
CreationDate: bucket.Created,
|
||||
@@ -584,7 +580,7 @@ func (web *webAPIHandlers) DownloadZip(w http.ResponseWriter, r *http.Request) {
|
||||
return objectAPI.GetObject(args.BucketName, objectName, 0, info.Size, writer)
|
||||
}
|
||||
|
||||
if !strings.HasSuffix(object, "/") {
|
||||
if !hasSuffix(object, slashSeparator) {
|
||||
// If not a directory, compress the file and write it to response.
|
||||
err := zipit(pathJoin(args.Prefix, object))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user