Skip to content

Commit

Permalink
[s3] StartAfter is exclusive. (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfaulkner-at authored Oct 16, 2024
1 parent d4d020c commit 18d581f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions services/s3/itest/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,15 +614,15 @@ func TestListObjectsV2(t *testing.T) {
t.Fatal("not 4 contents", resp.Contents)
}
// All of the contents should be in sorted order, and should be after "14"
if *resp.Contents[0].Key != "14" {
t.Fatal("should have found 14", resp.Contents[0])
if *resp.Contents[0].Key != "15" {
t.Fatal("should have found 15", resp.Contents[0])
}
if *resp.Contents[1].Key != "15" {
t.Fatal("should have found 15", resp.Contents[1])
if *resp.Contents[1].Key != "16" {
t.Fatal("should have found 16", resp.Contents[1])
}
// It should give us a reasonable continuation token.
if resp.NextContinuationToken == nil || *resp.NextContinuationToken != "16" {
t.Fatal("continuation token should be 16", resp.ContinuationToken)
if resp.NextContinuationToken == nil || *resp.NextContinuationToken != "17" {
t.Fatal("continuation token should be 17", resp.ContinuationToken)
}

// It should respect Prefix
Expand Down
2 changes: 1 addition & 1 deletion services/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ func (s *S3) ListObjectsV2(input ListObjectsV2Input) (*ListObjectsV2Output, *aws
break
}

if input.StartAfter != nil && key < *input.StartAfter {
if input.StartAfter != nil && key <= *input.StartAfter {
continue
}

Expand Down

0 comments on commit 18d581f

Please sign in to comment.