Skip to content

Commit

Permalink
v1.1.5 multipartComplete 接口默认 Content-Type: application/xml
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Dec 17, 2020
1 parent f95505c commit 3b3f5cb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 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.4';
COS.version = '1.1.5';

module.exports = COS;

Expand Down Expand Up @@ -7336,7 +7336,7 @@ function multipartComplete(params, callback) {
var xml = util.json2xml({ CompleteMultipartUpload: { Part: Parts } });

var headers = params.Headers;
if (!headers['Pic-Operations'] || !headers['pic-operations']) headers['Content-Type'] = '';else if (!headers['Content-Type'] && !headers['content-type']) headers['Content-Type'] = 'application/xml';
headers['Content-Type'] = 'application/xml';
headers['Content-MD5'] = util.binaryBase64(util.md5(xml));

submitRequest.call(this, {
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.4",
"version": "1.1.5",
"description": "JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions src/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2586,8 +2586,7 @@ function multipartComplete(params, callback) {
var xml = util.json2xml({CompleteMultipartUpload: {Part: Parts}});

var headers = params.Headers;
if (!headers['Pic-Operations'] || !headers['pic-operations']) headers['Content-Type'] = '';
else if (!headers['Content-Type'] && !headers['content-type']) headers['Content-Type'] = 'application/xml';
headers['Content-Type'] = 'application/xml';
headers['Content-MD5'] = util.binaryBase64(util.md5(xml));

submitRequest.call(this, {
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.4';
COS.version = '1.1.5';

module.exports = COS;

0 comments on commit 3b3f5cb

Please sign in to comment.