From 1783597fe3d00a467753f6ce28d93b0ad20503b1 Mon Sep 17 00:00:00 2001 From: Michael Schout Date: Fri, 4 Jun 2021 09:17:49 -0500 Subject: [PATCH] Fix Prefix used when fetching subsequent pages with ListObjectsV2 The Prefix that was used when fetching subsequent pages via the ContinuationToken was not the same prefix as the one used for the first page. This is incorrect, and causes the subsequent page fetches to fail. --- backends/aws_s3_backend.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backends/aws_s3_backend.go b/backends/aws_s3_backend.go index d139736..1e3adc5 100644 --- a/backends/aws_s3_backend.go +++ b/backends/aws_s3_backend.go @@ -373,7 +373,7 @@ func (a *AWSS3Backend) List(ctx context.Context, prefix string) ([]string, error resp, err = a.client.ListObjectsV2WithContext(ctx, &s3.ListObjectsV2Input{ Bucket: aws.String(a.bucketName), MaxKeys: aws.Int64(1000), - Prefix: aws.String(prefix), + Prefix: aws.String(a.prefix + prefix), ContinuationToken: resp.NextContinuationToken, }) if err != nil {