Comparing version 0.4.6 to 0.4.7
@@ -49,2 +49,10 @@ /*! | ||
function encodeSpecialCharacters(filename) { | ||
// Note: these characters are valid in URIs, but S3 does not like them for | ||
// some reason. | ||
return filename.replace(/[!'()*]/g, function (char) { | ||
return '%' + char.charCodeAt(0).toString(16); | ||
}); | ||
} | ||
function getHeader(headers, headerNameLowerCase) { | ||
@@ -118,3 +126,3 @@ for (var header in headers) { | ||
filename = ensureLeadingSlash(filename); | ||
filename = encodeSpecialCharacters(ensureLeadingSlash(filename)); | ||
@@ -659,3 +667,3 @@ // Default headers | ||
Client.prototype.signedUrl = function(filename, expiration){ | ||
Client.prototype.signedUrl = function(filename, expiration, otherParams){ | ||
var epoch = Math.floor(expiration.getTime()/1000) | ||
@@ -671,6 +679,9 @@ , pathname = url.parse(filename).pathname | ||
return this.url(ensureLeadingSlash(filename)) + | ||
'?Expires=' + epoch + | ||
'&AWSAccessKeyId=' + this.key + | ||
'&Signature=' + encodeURIComponent(signature); | ||
var queryString = qs.stringify(utils.merge({ | ||
Expires: epoch, | ||
AWSAccessKeyId: this.key, | ||
Signature: signature | ||
}, otherParams || {})); | ||
return this.url(ensureLeadingSlash(filename)) + '?' + queryString; | ||
}; | ||
@@ -677,0 +688,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["aws", "amazon", "s3"], | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"author": "TJ Holowaychuk <tj@learnboost.com>", | ||
@@ -8,0 +8,0 @@ "contributors": [ |
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
33101
831