From 45ea161f8d75706ae42d200a849aee05ebd257e9 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 23 Dec 2020 19:58:15 -0800 Subject: [PATCH] webUI: change listing to 1000 keys from browser UI (#11159) gateway implementations do not handle maxKeys being `-1` properly unlike MinIO implementation, handle it by setting an appropriate value. fixes #11158 --- cmd/web-handlers.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go index 16a3d385f..329a86e51 100644 --- a/cmd/web-handlers.go +++ b/cmd/web-handlers.go @@ -457,7 +457,7 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r // Fetch all the objects for { // Let listObjects reply back the maximum from server implementation - result, err := core.ListObjects(args.BucketName, args.Prefix, nextMarker, SlashSeparator, 0) + result, err := core.ListObjects(args.BucketName, args.Prefix, nextMarker, SlashSeparator, 1000) if err != nil { return toJSONError(ctx, err, args.BucketName) } @@ -571,8 +571,10 @@ func (web *webAPIHandlers) ListObjects(r *http.Request, args *ListObjectsArgs, r nextMarker := "" // Fetch all the objects for { - // Limit browser to defaults batches to be more responsive, scrolling friendly. - lo, err := listObjects(ctx, args.BucketName, args.Prefix, nextMarker, SlashSeparator, -1) + // Limit browser to '1000' batches to be more responsive, scrolling friendly. + // Also don't change the maxKeys value silly GCS SDKs do not honor maxKeys + // values to be '-1' + lo, err := listObjects(ctx, args.BucketName, args.Prefix, nextMarker, SlashSeparator, 1000) if err != nil { return &json2.Error{Message: err.Error()} }