Skip to content

Commit 9519347

Browse files
committed
feat:支持mimeLimit;trafficLimit
1 parent 58d224f commit 9519347

File tree

2 files changed

+10
-1
lines changed

2 files changed

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

sdk/advance.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,14 @@ function uploadSliceItem(params, callback) {
589589
ContentLength = end - start;
590590
}
591591

592+
var headersWhiteList = ['x-cos-traffic-limit', 'x-cos-mime-limit'];
593+
var headers = {};
594+
util.each(Headers, function(v, k) {
595+
if (headersWhiteList.indexOf(k) > -1) {
596+
headers[k] = v;
597+
}
598+
});
599+
592600
util.fileSlice(FilePath, start, end, function (md5Body) {
593601
util.getFileMd5(md5Body, function (err, md5) {
594602
var contentMd5 = md5 ? util.binaryBase64(md5) : '';
@@ -606,6 +614,7 @@ function uploadSliceItem(params, callback) {
606614
UploadId: UploadData.UploadId,
607615
ServerSideEncryption: ServerSideEncryption,
608616
Body: Body,
617+
Headers: headers,
609618
onProgress: params.onProgress,
610619
ContentMD5: contentMd5,
611620
}, function (err, data) {

0 commit comments

Comments
 (0)