Skip to content

Commit

Permalink
fix: s3 gateway SSE pagination (#10840)
Browse files Browse the repository at this point in the history
Fixes #10838
  • Loading branch information
StevenReitsma committed Nov 5, 2020
1 parent fb28aa8 commit 74f7cf2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/gateway/s3/gateway-s3-sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ type s3EncObjects struct {

// ListObjects lists all blobs in S3 bucket filtered by prefix
func (l *s3EncObjects) ListObjects(ctx context.Context, bucket string, prefix string, marker string, delimiter string, maxKeys int) (loi minio.ListObjectsInfo, e error) {
var continuationToken, startAfter string
res, err := l.ListObjectsV2(ctx, bucket, prefix, continuationToken, delimiter, maxKeys, false, startAfter)
var startAfter string
res, err := l.ListObjectsV2(ctx, bucket, prefix, marker, delimiter, maxKeys, false, startAfter)
if err != nil {
return loi, err
}
Expand All @@ -91,10 +91,12 @@ func (l *s3EncObjects) ListObjectsV2(ctx context.Context, bucket, prefix, contin
if e != nil {
return loi, minio.ErrorRespToObjectError(e, bucket)
}

continuationToken = loi.NextContinuationToken
isTruncated = loi.IsTruncated

for _, obj := range loi.Objects {
startAfter = obj.Name
continuationToken = loi.NextContinuationToken
isTruncated = loi.IsTruncated

if !isGWObject(obj.Name) {
continue
Expand Down

0 comments on commit 74f7cf2

Please sign in to comment.