Skip to content

Commit b12955d

Browse files
authored
feat: 新增 x-cos-sdk-retry 请求头 (#213)
1 parent 2e4f1f5 commit b12955d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
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.14.3",
3+
"version": "2.14.4",
44
"description": "cos nodejs sdk v5",
55
"main": "index.js",
66
"types": "index.d.ts",

sdk/base.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4034,6 +4034,7 @@ function submitRequest(params, callback) {
40344034
networkError,
40354035
});
40364036
params.SwitchHost = switchHost;
4037+
params.retry = true;
40374038
next(tryTimes + 1);
40384039
} else {
40394040
if (err && params.Action === 'name/cos:UploadPart') {
@@ -4127,6 +4128,9 @@ function _submitRequest(params, callback) {
41274128

41284129
// 清理 undefined 和 null 字段
41294130
opt.headers && (opt.headers = util.clearKey(opt.headers));
4131+
if (params.retry) {
4132+
opt.headers['x-cos-sdk-retry'] = true;
4133+
}
41304134
opt = util.clearKey(opt);
41314135

41324136
var Ip = this.options.Ip;

0 commit comments

Comments
 (0)