Skip to content

Commit

Permalink
v2.10.1 fix GetBucketReferer bug, fix clone bug
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Sep 10, 2021
1 parent 5a9a183 commit 1dde7ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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.10.0",
"version": "2.10.1",
"description": "cos nodejs sdk v5",
"main": "index.js",
"types": "index.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions sdk/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,7 @@ function getBucketReferer(params, callback) {

var RefererConfiguration = data.RefererConfiguration || {};
if (RefererConfiguration['DomainList']) {
var Domains = util.clone(RefererConfiguration['DomainList'].Domain || []);
Domains = util.makeArray(Domains);
var Domains = util.makeArray(RefererConfiguration['DomainList'].Domain || []);
RefererConfiguration.DomainList = {Domains: Domains};
}

Expand Down
1 change: 1 addition & 0 deletions sdk/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ var getFileMd5 = function (readStream, callback) {
};

function clone(obj) {
if (typeof obj !== 'object') return obj;
return map(obj, function (v) {
return typeof v === 'object' && v !== null ? clone(v) : v;
});
Expand Down

0 comments on commit 1dde7ff

Please sign in to comment.