Skip to content

Commit c841e15

Browse files
committed
Merge branch 'master' into dev/strictSign
2 parents ee87196 + 5040217 commit c841e15

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cos-nodejs-sdk-v5",
3-
"version": "2.16.0-beta.4",
3+
"version": "2.16.0-beta.5",
44
"description": "cos nodejs sdk v5",
55
"main": "index.js",
66
"types": "index.d.ts",

sdk/advance.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,9 +1617,11 @@ function downloadFile(params, callback) {
16171617

16181618
// 只校验文件大小和 crc64 是否有变更
16191619
var changed;
1620-
if (chunkHeaders['x-cos-hash-crc64ecma'] !== head.crc64ecma)
1620+
if (chunkHeaders['x-cos-hash-crc64ecma'] && head.crc64ecma && chunkHeaders['x-cos-hash-crc64ecma'] !== head.crc64ecma) {
16211621
changed = 'download error, x-cos-hash-crc64ecma has changed.';
1622-
else if (totalSize !== head.size) changed = 'download error, Last-Modified has changed.';
1622+
} else if (totalSize !== head.size) {
1623+
changed = 'download error, Last-Modified has changed.';
1624+
}
16231625
// else if (data.ETag !== head.ETag) error = 'download error, ETag has changed.';
16241626
// else if (chunkHeaders['last-modified'] !== head.mtime) error = 'download error, Last-Modified has changed.';
16251627

test/test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6181,8 +6181,7 @@ group('getObject() 手动关闭合并 Key 校验', function () {
61816181
},
61826182
function (err, data) {
61836183
console.log('getObject Body1', err || data);
6184-
assert.ok(data.Body.toString().includes('ListBucketResult'));
6185-
// assert.ok(err);
6184+
assert.ok(err);
61866185
done();
61876186
}
61886187
);
@@ -6200,8 +6199,7 @@ group('getObject() 手动关闭合并 Key 校验', function () {
62006199
},
62016200
function (err, data) {
62026201
console.log('getObject Body3', err || data);
6203-
assert.ok(data.Body.toString().includes('ListBucketResult'));
6204-
// assert.ok(err);
6202+
assert.ok(err);
62056203
done();
62066204
}
62076205
);

0 commit comments

Comments
 (0)