cos-nodejs-sdk-v5
Advanced tools
Comparing version 2.12.6 to 2.13.0
{ | ||
"name": "cos-nodejs-sdk-v5", | ||
"version": "2.12.6", | ||
"version": "2.13.0", | ||
"description": "cos nodejs sdk v5", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,6 +28,3 @@ var session = require('./session'); | ||
if (!self._isRunningTask(TaskId)) return; | ||
var _err = { | ||
UploadId: params.UploadData.UploadId || '', | ||
err: err, | ||
}; | ||
err.UploadId = params.UploadData.UploadId || ''; | ||
return callback(_err); | ||
@@ -656,2 +653,3 @@ }); | ||
var PartItem = UploadData.PartList[PartNumber - 1]; | ||
var switchHost = false; | ||
Async.retry( | ||
@@ -676,5 +674,9 @@ ChunkRetryTimes, | ||
ContentMD5: contentMd5, | ||
SwitchHost: switchHost, | ||
}, | ||
function (err, data) { | ||
if (!self._isRunningTask(TaskId)) return; | ||
if (err) { | ||
switchHost = err?.switchHost; | ||
} | ||
if (err) return tryCallback(err); | ||
@@ -688,2 +690,5 @@ PartItem.Uploaded = true; | ||
function (err, data) { | ||
if (err) { | ||
delete err.switchHost; | ||
} | ||
if (!self._isRunningTask(TaskId)) return; | ||
@@ -690,0 +695,0 @@ return callback(err, data); |
@@ -47,2 +47,3 @@ 'use strict'; | ||
ForceSignHost: true, // 默认将host加入签名计算,关闭后可能导致越权风险,建议保持为true | ||
AutoSwitchHost: true, | ||
// 动态秘钥,优先级Credentials > SecretId/SecretKey。注意Cred内是小写的secretId、secretKey | ||
@@ -105,2 +106,3 @@ Credentials: { | ||
if (util.isWeb()) { | ||
console.log('Tip: 使用 electron 等跨平台技术可正常使用Nodejs SDK,请忽略下方浏览器环境警告'); | ||
console.warn( | ||
@@ -113,2 +115,8 @@ 'warning: cos-nodejs-sdk-v5 不支持浏览器使用,请改用 cos-js-sdk-v5,参考文档: https://cloud.tencent.com/document/product/436/11459' | ||
} | ||
if (this.options.ForcePathStyle) { | ||
console.warn( | ||
'cos-nodejs-sdk-v5不再支持使用path-style,仅支持使用virtual-hosted-style,参考文档:https://cloud.tencent.com/document/product/436/96243' | ||
); | ||
throw new Error('ForcePathStyle is not supported'); | ||
} | ||
event.init(this); | ||
@@ -115,0 +123,0 @@ task.init(this); |
@@ -378,3 +378,4 @@ 'use strict'; | ||
apiName === 'sliceUploadFile' || | ||
apiName === 'abortUploadTask' | ||
apiName === 'abortUploadTask' || | ||
apiName === 'uploadFile' | ||
) { | ||
@@ -381,0 +382,0 @@ if (!Bucket) return 'Bucket'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
870081
21593