mirror of
https://github.com/versity/versitygw.git
synced 2026-01-05 03:24:04 +00:00
fix: Fixes #249, Changed ListObjects default max-keys from -1 to 1000
This commit is contained in:
committed by
Ben McClelland
parent
7eeaee8a54
commit
a67a2e5c8f
@@ -1509,6 +1509,31 @@ func ListObjects_delimiter(s *S3Conf) {
|
||||
})
|
||||
}
|
||||
|
||||
func ListObjects_max_keys_none(s *S3Conf) {
|
||||
testName := "ListObjects_max_keys_none"
|
||||
actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
|
||||
err := putObjects(s3client, []string{"foo", "bar", "baz"}, bucket)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), shortTimeout)
|
||||
out, err := s3client.ListObjects(ctx, &s3.ListObjectsInput{
|
||||
Bucket: &bucket,
|
||||
})
|
||||
cancel()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if out.MaxKeys != 1000 {
|
||||
return fmt.Errorf("expected max-keys to be 1000, instead got %v", out.MaxKeys)
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func DeleteObject_non_existing_object(s *S3Conf) {
|
||||
testName := "DeleteObject_non_existing_object"
|
||||
actionHandler(s, testName, func(s3client *s3.Client, bucket string) error {
|
||||
|
||||
Reference in New Issue
Block a user