Skip to content

Commit

Permalink
分片上传支持 pic-operations 传递给 complete 接口
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Dec 16, 2020
1 parent 3ff5e29 commit 4c46823
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dist/cos-js-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,7 @@ base.init(COS, task);
advance.init(COS, task);

COS.getAuthorization = util.getAuth;
COS.version = '1.1.2';
COS.version = '1.1.3';

module.exports = COS;

Expand Down Expand Up @@ -8364,7 +8364,8 @@ function sliceUploadFile(params, callback) {
ep.on('upload_slice_complete', function (UploadData) {
var metaHeaders = {};
util.each(params.Headers, function (val, k) {
if (k.toLowerCase().indexOf('x-cos-meta-') === 0) metaHeaders[k] = val;
var shortKey = k.toLowerCase();
if (shortKey.indexOf('x-cos-meta-') === 0 || shortKey === 'pic-operations') metaHeaders[k] = val;
});
uploadSliceComplete.call(self, {
Bucket: Bucket,
Expand Down
2 changes: 1 addition & 1 deletion dist/cos-js-sdk-v5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-js-sdk-v5",
"version": "1.1.2",
"version": "1.1.3",
"description": "JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/advance.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ function sliceUploadFile(params, callback) {
ep.on('upload_slice_complete', function (UploadData) {
var metaHeaders = {};
util.each(params.Headers, function (val, k) {
if (k.toLowerCase().indexOf('x-cos-meta-') === 0) metaHeaders[k] = val;
var shortKey = k.toLowerCase();
if (shortKey.indexOf('x-cos-meta-') === 0 || shortKey === 'pic-operations') metaHeaders[k] = val;
});
uploadSliceComplete.call(self, {
Bucket: Bucket,
Expand Down
2 changes: 1 addition & 1 deletion src/cos.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ base.init(COS, task);
advance.init(COS, task);

COS.getAuthorization = util.getAuth;
COS.version = '1.1.2';
COS.version = '1.1.3';

module.exports = COS;

0 comments on commit 4c46823

Please sign in to comment.