Skip to content

Commit

Permalink
bf(CLDSRV-232): Prevent empty NextContinuationToken from being sent a…
Browse files Browse the repository at this point in the history
…t listing end
  • Loading branch information
tmacro committed Jul 5, 2022
1 parent a2ae5cc commit 4069a94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/api/bucketGet.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ function processMasterVersions(bucketName, listParams, list) {
} else if (p.tag !== 'NextMarker' &&
p.tag !== 'EncodingType' &&
p.tag !== 'Delimiter' &&
p.tag !== 'StartAfter') {
p.tag !== 'StartAfter' &&
p.tag !== 'NextContinuationToken') {
xml.push(`<${p.tag}/>`);
}
});
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/bucketGet.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ describe('bucketGet API V2', () => {
assert.strictEqual(keyCount, keysReturned);
// assert the results from tests
test.assertion(result);
if (result.ListBucketResult.IsTruncated && result.ListBucketResult.IsTruncated[0] === 'false') {
assert.strictEqual(result.ListBucketResult.NextContinuationToken, undefined);
}
done();
});
});
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/api/objectGet.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ describe('objectGet API', () => {
url: `/${bucketName}/${objectName}`,
}, postBody);

const testDate = new Date(2022, 6, 3).toISOString();
const threeDaysMilliSecs = 3 * 24 * 60 * 60 * 1000;
const testDate = new Date(Date.now() + threeDaysMilliSecs).toISOString();

it('should get the object metadata with valid retention info', done => {
bucketPut(authInfo, testPutBucketRequestObjectLock, log, () => {
Expand Down

0 comments on commit 4069a94

Please sign in to comment.