Skip to content

Commit 6473702

Browse files
author
carsonxu
committed
优化缺 CORS ETag 配置的的报错
1 parent 287d436 commit 6473702

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

dist/cos-js-sdk-v5.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ var getFileMd5 = function (blob, callback, onProgress) {
311311

312312
function clone(obj) {
313313
return map(obj, function (v) {
314-
return typeof v === 'object' ? clone(v) : v;
314+
return typeof v === 'object' && v !== null ? clone(v) : v;
315315
});
316316
}
317317

@@ -2161,7 +2161,7 @@ base.init(COS, task);
21612161
advance.init(COS, task);
21622162

21632163
COS.getAuthorization = util.getAuth;
2164-
COS.version = '1.0.3';
2164+
COS.version = '1.0.4';
21652165

21662166
module.exports = COS;
21672167

@@ -7310,7 +7310,7 @@ function multipartUpload(params, callback) {
73107310
}, function (err, data) {
73117311
if (err) return callback(err);
73127312
callback(null, {
7313-
ETag: util.attr(data.headers, 'etag', {}),
7313+
ETag: util.attr(data.headers, 'etag', ''),
73147314
statusCode: data.statusCode,
73157315
headers: data.headers
73167316
});

dist/cos-js-sdk-v5.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cos-js-sdk-v5",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)",
55
"main": "index.js",
66
"scripts": {

src/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2559,7 +2559,7 @@ function multipartUpload(params, callback) {
25592559
}, function (err, data) {
25602560
if (err) return callback(err);
25612561
callback(null, {
2562-
ETag: util.attr(data.headers, 'etag', {}),
2562+
ETag: util.attr(data.headers, 'etag', ''),
25632563
statusCode: data.statusCode,
25642564
headers: data.headers,
25652565
});

src/cos.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ base.init(COS, task);
5959
advance.init(COS, task);
6060

6161
COS.getAuthorization = util.getAuth;
62-
COS.version = '1.0.3';
62+
COS.version = '1.0.4';
6363

6464
module.exports = COS;

src/util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ var getFileMd5 = function (blob, callback, onProgress) {
248248

249249
function clone(obj) {
250250
return map(obj, function (v) {
251-
return typeof v === 'object' ? clone(v) : v;
251+
return typeof v === 'object' && v !== null ? clone(v) : v;
252252
});
253253
}
254254

0 commit comments

Comments
 (0)