s3: fix detection of listing routines which don't support v2 properly

In this commit

ab849b3613 s3: fix listing loop when using v2 listing on v1 server

The ContinuationToken was tested for existence, but it is the
NextContinuationToken that we are interested in.

See: #6600
This commit is contained in:
Nick Craig-Wood 2022-12-13 12:19:00 +00:00
parent 5a59b49b6b
commit 6c407dbe15
1 changed files with 2 additions and 2 deletions

View File

@ -3235,8 +3235,8 @@ func (ls *v2List) List(ctx context.Context) (resp *s3.ListObjectsV2Output, versi
if err != nil {
return nil, nil, err
}
if aws.BoolValue(resp.IsTruncated) && (resp.ContinuationToken == nil || *resp.ContinuationToken == "") {
return nil, nil, errors.New("s3 protocol error: received listing v2 with IsTruncated set and no ContinuationToken. Should you be using `--s3-list-version 1`?")
if aws.BoolValue(resp.IsTruncated) && (resp.NextContinuationToken == nil || *resp.NextContinuationToken == "") {
return nil, nil, errors.New("s3 protocol error: received listing v2 with IsTruncated set and no NextContinuationToken. Should you be using `--s3-list-version 1`?")
}
ls.req.ContinuationToken = resp.NextContinuationToken
return resp, nil, nil