From a1ef90be52a65bd336af9186a5a692458e686e06 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Fri, 13 Jul 2018 22:57:26 +0530 Subject: [PATCH] gcs: Limit number of objects listed to max-keys (#6133) --- cmd/gateway/gcs/gateway-gcs.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/gateway/gcs/gateway-gcs.go b/cmd/gateway/gcs/gateway-gcs.go index fa06054fe..911f945d7 100644 --- a/cmd/gateway/gcs/gateway-gcs.go +++ b/cmd/gateway/gcs/gateway-gcs.go @@ -669,7 +669,6 @@ func (l *gcsGateway) ListObjectsV2(ctx context.Context, bucket, prefix, continua }) isTruncated := false - it.PageInfo().MaxSize = maxKeys if continuationToken != "" { // If client sends continuationToken, set it @@ -687,7 +686,7 @@ func (l *gcsGateway) ListObjectsV2(ctx context.Context, bucket, prefix, continua var prefixes []string var objects []minio.ObjectInfo - for { + for keyCount := 0; keyCount < maxKeys; keyCount++ { attrs, err := it.Next() if err == iterator.Done { break