Comparing version 0.4.3 to 0.4.4
@@ -49,5 +49,5 @@ /*! | ||
function getContentLength(headers) { | ||
function getHeader(headers, headerNameLowerCase) { | ||
for (var header in headers) { | ||
if (header.toLowerCase() === 'content-length') { | ||
if (header.toLowerCase() === headerNameLowerCase) { | ||
return headers[header]; | ||
@@ -96,2 +96,8 @@ } | ||
if (options.bucket.indexOf('.') !== -1 && this.secure) { | ||
throw new Error('AWS bucket names with periods in them cannot be used ' + | ||
'alongside SSL (the default). Set `secure: false` to turn off SSL and ' + | ||
'use HTTP instead.'); | ||
} | ||
this.url = this.secure ? this.https : this.http; | ||
@@ -137,4 +143,4 @@ }; | ||
, resource: auth.canonicalizeResource('/' + this.bucket + filename) | ||
, contentType: headers['Content-Type'] | ||
, md5: headers['Content-MD5'] || '' | ||
, contentType: getHeader(headers, 'content-type') | ||
, md5: getHeader(headers, 'content-md5') || '' | ||
, amazonHeaders: auth.canonicalizeHeaders(headers) | ||
@@ -260,3 +266,3 @@ }); | ||
Client.prototype.putStream = function(stream, filename, headers, fn){ | ||
var contentLength = getContentLength(headers); | ||
var contentLength = getHeader(headers, 'content-length'); | ||
if (contentLength === null) { | ||
@@ -263,0 +269,0 @@ process.nextTick(function () { |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["aws", "amazon", "s3"], | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"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
32997
827