Comparing version 5.1.0 to 5.1.1
@@ -5,2 +5,18 @@ # Change Log | ||
<a name="5.1.1"></a> | ||
# [5.1.1](https://github.com/aliyun/oss-nodejs-sdk/compare/5.1.0...5.1.1) (2018-04-16) | ||
### Bug Fixes | ||
* **Browser:** multipartUpload callback resumble parse error ([#442](https://github.com/aliyun/oss-nodejs-sdk/issues/442)) ([e22ecf6](https://github.com/aliyun/oss-nodejs-sdk/commit/e22ecf6)) | ||
* **Browser:** signatureUrl with content-type and content-md5 ([#441](https://github.com/aliyun/oss-nodejs-sdk/issues/441)) ([50f0093](https://github.com/aliyun/oss-nodejs-sdk/commit/50f0093)) | ||
### Docs | ||
* example base64 to blob and doc ([#434](https://github.com/aliyun/oss-nodejs-sdk/issues/434)) ([37f65f0](https://github.com/aliyun/oss-nodejs-sdk/commit/37f65f0)) | ||
<a name="5.1.0"></a> | ||
@@ -7,0 +23,0 @@ # [5.1.0](https://github.com/aliyun/oss-nodejs-sdk/compare/5.0.1...5.1.0) (2018-04-14) |
@@ -71,3 +71,3 @@ | ||
if (options.headers && options.headers['x-oss-callback']) { | ||
if ((options.headers && options.headers['x-oss-callback']) || options.callback) { | ||
ret.data = result.data; | ||
@@ -74,0 +74,0 @@ } |
@@ -15,2 +15,3 @@ | ||
const signHelper = require('../common/signUtils'); | ||
// var assert = require('assert'); | ||
@@ -90,2 +91,3 @@ | ||
const params = this._objectRequestParams(method, name, options); | ||
callback.encodeCallback(params, options); | ||
params.mime = options.mime; | ||
@@ -95,4 +97,2 @@ params.content = content; | ||
callback.encodeCallback(options); | ||
const result = yield this.request(params); | ||
@@ -106,3 +106,3 @@ | ||
if (options.headers && options.headers['x-oss-callback']) { | ||
if (params.headers && params.headers['x-oss-callback']) { | ||
ret.data = JSON.parse(result.data.toString()); | ||
@@ -134,3 +134,3 @@ } | ||
const params = this._objectRequestParams(method, name, options); | ||
callback.encodeCallback(params, options); | ||
params.mime = options.mime; | ||
@@ -140,4 +140,2 @@ params.stream = stream; | ||
callback.encodeCallback(options); | ||
const result = yield this.request(params); | ||
@@ -151,3 +149,3 @@ | ||
if (options.headers && options.headers['x-oss-callback']) { | ||
if (params.headers && params.headers['x-oss-callback']) { | ||
ret.data = JSON.parse(result.data.toString()); | ||
@@ -514,3 +512,4 @@ } | ||
if (options.headers) { | ||
params.headers = options.headers; | ||
params.headers = {}; | ||
copy(options.headers).to(params.headers); | ||
} | ||
@@ -517,0 +516,0 @@ return params; |
@@ -1,1 +0,1 @@ | ||
exports.version="5.1.0" | ||
exports.version="5.1.1" |
exports.encodeCallback = function (options) { | ||
options.headers = options.headers || {}; | ||
if (!Object.prototype.hasOwnProperty.call(options.headers, 'x-oss-callback')) { | ||
exports.encodeCallback = function encodeCallback(reqParams, options) { | ||
reqParams.headers = reqParams.headers || {}; | ||
if (!Object.prototype.hasOwnProperty.call(reqParams.headers, 'x-oss-callback')) { | ||
if (options.callback) { | ||
@@ -18,3 +18,3 @@ const json = { | ||
const callback = new Buffer(JSON.stringify(json)).toString('base64'); | ||
options.headers['x-oss-callback'] = callback; | ||
reqParams.headers['x-oss-callback'] = callback; | ||
@@ -26,3 +26,3 @@ if (options.callback.customValue) { | ||
}); | ||
options.headers['x-oss-callback-var'] = new Buffer(JSON.stringify(callbackVar)).toString('base64'); | ||
reqParams.headers['x-oss-callback-var'] = new Buffer(JSON.stringify(callbackVar)).toString('base64'); | ||
} | ||
@@ -29,0 +29,0 @@ } |
const copy = require('copy-to'); | ||
const callback = require('./callback'); | ||
@@ -16,4 +16,6 @@ | ||
options = options || {}; | ||
options.subres = 'uploads'; | ||
const params = this._objectRequestParams('GET', '', options); | ||
const opt = {}; | ||
copy(options).to(opt); | ||
opt.subres = 'uploads'; | ||
const params = this._objectRequestParams('GET', '', opt); | ||
params.query = query; | ||
@@ -57,6 +59,8 @@ params.xmlResponse = true; | ||
options = options || {}; | ||
options.subres = { | ||
const opt = {}; | ||
copy(options).to(opt); | ||
opt.subres = { | ||
uploadId, | ||
}; | ||
const params = this._objectRequestParams('GET', name, options); | ||
const params = this._objectRequestParams('GET', name, opt); | ||
params.query = query; | ||
@@ -90,4 +94,6 @@ params.xmlResponse = true; | ||
options = options || {}; | ||
options.subres = { uploadId }; | ||
const params = this._objectRequestParams('DELETE', name, options); | ||
const opt = {}; | ||
copy(options).to(opt); | ||
opt.subres = { uploadId }; | ||
const params = this._objectRequestParams('DELETE', name, opt); | ||
params.successStatuses = [204]; | ||
@@ -109,7 +115,9 @@ | ||
options = options || {}; | ||
options.headers = options.headers || {}; | ||
this._convertMetaToHeaders(options.meta, options.headers); | ||
const opt = {}; | ||
copy(options).to(opt); | ||
opt.headers = opt.headers || {}; | ||
this._convertMetaToHeaders(options.meta, opt.headers); | ||
options.subres = 'uploads'; | ||
const params = this._objectRequestParams('POST', name, options); | ||
opt.subres = 'uploads'; | ||
const params = this._objectRequestParams('POST', name, opt); | ||
params.mime = options.mime; | ||
@@ -180,10 +188,12 @@ params.xmlResponse = true; | ||
options = options || {}; | ||
options.subres = { uploadId }; | ||
const params = this._objectRequestParams('POST', name, options); | ||
const opt = {}; | ||
copy(options).to(opt); | ||
opt.subres = { uploadId }; | ||
const params = this._objectRequestParams('POST', name, opt); | ||
callback.encodeCallback(params, opt); | ||
params.mime = 'xml'; | ||
params.content = xml; | ||
callback.encodeCallback(options); | ||
if (!(options.headers && options.headers['x-oss-callback'])) { | ||
if (!(params.headers && params.headers['x-oss-callback'])) { | ||
params.xmlResponse = true; | ||
@@ -201,3 +211,3 @@ } | ||
if (options.headers && options.headers['x-oss-callback']) { | ||
if (params.headers && params.headers['x-oss-callback']) { | ||
ret.data = JSON.parse(result.data.toString()); | ||
@@ -219,12 +229,14 @@ } | ||
options = options || {}; | ||
options.headers = { | ||
const opt = {}; | ||
copy(options).to(opt); | ||
opt.headers = { | ||
'Content-Length': data.size, | ||
}; | ||
options.subres = { | ||
opt.subres = { | ||
partNumber: partNo, | ||
uploadId, | ||
}; | ||
const params = this._objectRequestParams('PUT', name, options); | ||
params.mime = options.mime; | ||
const params = this._objectRequestParams('PUT', name, opt); | ||
params.mime = opt.mime; | ||
params.stream = data.stream; | ||
@@ -231,0 +243,0 @@ params.successStatuses = [200]; |
@@ -127,2 +127,6 @@ | ||
headers[lowerKey] = value; | ||
} else if (lowerKey.indexOf('content-md5') === 0) { | ||
headers[key] = value; | ||
} else if (lowerKey.indexOf('content-type') === 0) { | ||
headers[key] = value; | ||
} else if (lowerKey !== 'expires' && lowerKey !== 'response' && lowerKey !== 'process' && lowerKey !== 'method') { | ||
@@ -129,0 +133,0 @@ subResource[lowerKey] = value; |
@@ -61,3 +61,3 @@ | ||
if (options.headers && options.headers['x-oss-callback']) { | ||
if ((options.headers && options.headers['x-oss-callback']) || options.callback) { | ||
ret.data = result.data; | ||
@@ -64,0 +64,0 @@ } |
@@ -80,6 +80,7 @@ | ||
callback.encodeCallback(options); | ||
const method = options.method || 'PUT'; | ||
const params = this._objectRequestParams(method, name, options); | ||
callback.encodeCallback(params, options); | ||
params.mime = options.mime; | ||
@@ -97,3 +98,3 @@ params.content = content; | ||
if (options.headers && options.headers['x-oss-callback']) { | ||
if (params.headers && params.headers['x-oss-callback']) { | ||
ret.data = JSON.parse(result.data.toString()); | ||
@@ -123,7 +124,5 @@ } | ||
callback.encodeCallback(options); | ||
const method = options.method || 'PUT'; | ||
const params = this._objectRequestParams(method, name, options); | ||
callback.encodeCallback(params, options); | ||
params.mime = options.mime; | ||
@@ -141,3 +140,3 @@ params.stream = stream; | ||
if (options.headers && options.headers['x-oss-callback']) { | ||
if (params.headers && params.headers['x-oss-callback']) { | ||
ret.data = JSON.parse(result.data.toString()); | ||
@@ -510,3 +509,4 @@ } | ||
if (options.headers) { | ||
params.headers = options.headers; | ||
params.headers = {}; | ||
copy(options.headers).to(params.headers); | ||
} | ||
@@ -513,0 +513,0 @@ return params; |
{ | ||
"name": "ali-oss", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "aliyun oss(object storage service) node client", | ||
@@ -5,0 +5,0 @@ "main": "lib/client.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1473135
28867
1
15
14