Skip to content

Commit 4069a94

Browse files
committed
bf(CLDSRV-232): Prevent empty NextContinuationToken from being sent at listing end
1 parent a2ae5cc commit 4069a94

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

lib/api/bucketGet.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ function processMasterVersions(bucketName, listParams, list) {
218218
} else if (p.tag !== 'NextMarker' &&
219219
p.tag !== 'EncodingType' &&
220220
p.tag !== 'Delimiter' &&
221-
p.tag !== 'StartAfter') {
221+
p.tag !== 'StartAfter' &&
222+
p.tag !== 'NextContinuationToken') {
222223
xml.push(`<${p.tag}/>`);
223224
}
224225
});

tests/unit/api/bucketGet.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ describe('bucketGet API V2', () => {
313313
assert.strictEqual(keyCount, keysReturned);
314314
// assert the results from tests
315315
test.assertion(result);
316+
if (result.ListBucketResult.IsTruncated && result.ListBucketResult.IsTruncated[0] === 'false') {
317+
assert.strictEqual(result.ListBucketResult.NextContinuationToken, undefined);
318+
}
316319
done();
317320
});
318321
});

tests/unit/api/objectGet.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ describe('objectGet API', () => {
9999
url: `/${bucketName}/${objectName}`,
100100
}, postBody);
101101

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

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

0 commit comments

Comments
 (0)