Skip to content

Commit

Permalink
feat: 新增 x-cos-sdk-retry 请求头 (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
livehigh authored Jul 25, 2024
1 parent 2e4f1f5 commit b12955d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-nodejs-sdk-v5",
"version": "2.14.3",
"version": "2.14.4",
"description": "cos nodejs sdk v5",
"main": "index.js",
"types": "index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions sdk/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4034,6 +4034,7 @@ function submitRequest(params, callback) {
networkError,
});
params.SwitchHost = switchHost;
params.retry = true;
next(tryTimes + 1);
} else {
if (err && params.Action === 'name/cos:UploadPart') {
Expand Down Expand Up @@ -4127,6 +4128,9 @@ function _submitRequest(params, callback) {

// 清理 undefined 和 null 字段
opt.headers && (opt.headers = util.clearKey(opt.headers));
if (params.retry) {
opt.headers['x-cos-sdk-retry'] = true;
}
opt = util.clearKey(opt);

var Ip = this.options.Ip;
Expand Down

0 comments on commit b12955d

Please sign in to comment.