Compare commits

...

1 Commits

Author SHA1 Message Date
Mathieu Cassagne 0df5b10fe4 ListExtensions(fix): IsTruncated
- When the numbers of listed keys is strictly equal to the asked
  maxKeys, we should return IsTruncated = false.
2016-07-19 09:40:54 +00:00
2 changed files with 5 additions and 3 deletions

View File

@ -84,10 +84,11 @@ class MultipartUploads {
* @return {Boolean} - True: Continue, False: Stop * @return {Boolean} - True: Continue, False: Stop
*/ */
filter(obj) { filter(obj) {
// Check first in case of maxkeys = 0 // Check first in case of maxkeys <= 0
if (this.keys >= this.maxKeys) { if (this.keys >= this.maxKeys) {
// In cases of maxKeys <= 0 => IsTruncated = false // In cases of maxKeys <= 0 => IsTruncated = false
this.IsTruncated = this.maxKeys > 0; // If keys === maxKeys => IsTruncated should be false
this.IsTruncated = this.maxKeys > 0 && this.keys > this.maxKeys;
return false; return false;
} }
const key = obj.key; const key = obj.key;

View File

@ -98,7 +98,8 @@ class Delimiter {
// Check first in case of maxkeys <= 0 // Check first in case of maxkeys <= 0
if (this.keys >= this.maxKeys) { if (this.keys >= this.maxKeys) {
// In cases of maxKeys <= 0 => IsTruncated = false // In cases of maxKeys <= 0 => IsTruncated = false
this.IsTruncated = this.maxKeys > 0; // If keys === maxKeys => IsTruncated should be false
this.IsTruncated = this.maxKeys > 0 && this.keys > this.maxKeys;
return false; return false;
} }
const key = obj.key; const key = obj.key;