Skip to content

Commit

Permalink
feat:支持mimeLimit;trafficLimit
Browse files Browse the repository at this point in the history
  • Loading branch information
livehigh committed Nov 11, 2021
1 parent 58d224f commit 9519347
Show file tree
Hide file tree
Showing 2 changed files with 10 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.10.8",
"version": "2.10.9",
"description": "cos nodejs sdk v5",
"main": "index.js",
"types": "index.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions sdk/advance.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,14 @@ function uploadSliceItem(params, callback) {
ContentLength = end - start;
}

var headersWhiteList = ['x-cos-traffic-limit', 'x-cos-mime-limit'];
var headers = {};
util.each(Headers, function(v, k) {
if (headersWhiteList.indexOf(k) > -1) {
headers[k] = v;
}
});

util.fileSlice(FilePath, start, end, function (md5Body) {
util.getFileMd5(md5Body, function (err, md5) {
var contentMd5 = md5 ? util.binaryBase64(md5) : '';
Expand All @@ -606,6 +614,7 @@ function uploadSliceItem(params, callback) {
UploadId: UploadData.UploadId,
ServerSideEncryption: ServerSideEncryption,
Body: Body,
Headers: headers,
onProgress: params.onProgress,
ContentMD5: contentMd5,
}, function (err, data) {
Expand Down

0 comments on commit 9519347

Please sign in to comment.