Skip to content

Commit

Permalink
支持 Query/CI
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Dec 1, 2020
1 parent 91dcd0e commit e38e060
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 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.0';
COS.version = '1.1.1';

module.exports = COS;

Expand Down Expand Up @@ -6527,7 +6527,7 @@ function listObjectVersions(params, callback) {
* @param {Object} data 为对应的 object 数据,包括 body 和 headers
*/
function getObject(params, callback) {
var reqParams = {};
var reqParams = params.Query || {};

reqParams['response-content-type'] = params['ResponseContentType'];
reqParams['response-content-language'] = params['ResponseContentLanguage'];
Expand Down Expand Up @@ -6622,6 +6622,7 @@ function putObject(params, callback) {
Region: params.Region,
Key: params.Key,
headers: params.Headers,
qs: params.Query,
body: params.Body,
onProgress: onProgress
}, function (err, data) {
Expand All @@ -6639,13 +6640,9 @@ function putObject(params, callback) {
object: params.Key
});
url = url.substr(url.indexOf('://') + 3);
var result = {
Location: url,
ETag: util.attr(data.headers, 'etag', ''),
statusCode: data.statusCode,
headers: data.headers
};
callback(null, result);
data.Location = url;
data.ETag = util.attr(data.headers, 'etag', '');
callback(null, data);
});
}, params.onHashProgress);
}
Expand Down Expand Up @@ -7242,7 +7239,8 @@ function multipartInit(params, callback) {
Region: params.Region,
Key: params.Key,
action: 'uploads',
headers: params.Headers
headers: params.Headers,
qs: params.Query
}, function (err, data) {
if (err) {
return callback(err);
Expand Down Expand Up @@ -8605,6 +8603,7 @@ function getUploadIdAndPartList(params, callback) {
Region: Region,
Key: Key,
Headers: util.clone(params.Headers),
Query: util.clone(params.Query),
StorageClass: StorageClass,
Body: params.Body
}, params);
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.0';
COS.version = '1.1.1';

module.exports = COS;

0 comments on commit e38e060

Please sign in to comment.