From 4b4408ce6805a26d8441a1bbc40051a6593ae904 Mon Sep 17 00:00:00 2001 From: giuli007 Date: Mon, 21 Mar 2022 13:49:09 -0700 Subject: [PATCH] Use the newer recommended S3 ListObjectsV2 API --- s3/public.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s3/public.go b/s3/public.go index d6c161add3..15c174e811 100644 --- a/s3/public.go +++ b/s3/public.go @@ -372,13 +372,13 @@ func (storage *PublishedStorage) internalFilelist(prefix string, hidePlusWorkaro prefix += "/" } - params := &s3.ListObjectsInput{ + params := &s3.ListObjectsV2Input{ Bucket: aws.String(storage.bucket), Prefix: aws.String(prefix), MaxKeys: aws.Int64(1000), } - err = storage.s3.ListObjectsPages(params, func(contents *s3.ListObjectsOutput, lastPage bool) bool { + err = storage.s3.ListObjectsV2Pages(params, func(contents *s3.ListObjectsV2Output, lastPage bool) bool { for _, key := range contents.Contents { if storage.plusWorkaround && hidePlusWorkaround && strings.Contains(*key.Key, " ") { // if we use plusWorkaround, we want to hide those duplicates