Comparing version 2.5.0 to 2.5.1
2.5.1 / 2015-08-24 | ||
================== | ||
* fix: remove unnecessary decode | ||
* fix: signature url | ||
* fix: escape resource | ||
2.5.0 / 2015-08-22 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -29,2 +29,3 @@ /**! | ||
var merge = require('merge-descriptors'); | ||
var url = require('url'); | ||
@@ -190,7 +191,6 @@ /** | ||
var resource = params.resource; | ||
var authResource = params.authResource || resource; | ||
var authResource = params.authResource || params.resource; | ||
headers.authorization = this.authorization(params.method, authResource, headers); | ||
var url = 'http://' + host + resource; | ||
var url = 'http://' + host + this._escape(params.resource); | ||
if (params.query) { | ||
@@ -251,2 +251,15 @@ url += '?' + querystring.stringify(params.query); | ||
proto._escape = function (resource) { | ||
resource = resource || ''; | ||
var parsed = url.parse(resource); | ||
if (!parsed.pathname) { | ||
return resource; | ||
} | ||
parsed.pathname = parsed.pathname.split('/').map(function (p) { | ||
return encodeURIComponent(p); | ||
}).join('/'); | ||
return url.format(parsed); | ||
}; | ||
proto._getRegionHost = function (region) { | ||
@@ -253,0 +266,0 @@ if (this.options.internal) { |
@@ -173,3 +173,2 @@ /**! | ||
params.successStatuses = [200]; | ||
var result = yield* this.request(params); | ||
@@ -305,3 +304,5 @@ | ||
var url = 'http://'; | ||
url += customHost ? (customHost + '/' + name) : (options.host + authResource); | ||
url += customHost | ||
? customHost + '/' + this._escape(name) | ||
: options.host + this._escape(authResource); | ||
@@ -308,0 +309,0 @@ return url + '?OSSAccessKeyId=' + encodeURIComponent(options.accessKeyId) + |
{ | ||
"name": "ali-oss", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "aliyun oss(open storage service) node client", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
87998
1100