Comparing version 0.5.5 to 0.5.6
@@ -0,1 +1,4 @@ | ||
## v0.5.6 | ||
* Fixes the broken Content-Length header if Content-Type was manually specified for the S3 PUT operation. | ||
## v0.5.5 | ||
@@ -2,0 +5,0 @@ * Added Amazon CloudFormation support. |
@@ -265,3 +265,3 @@ /* 3rd party module */ | ||
bfile.on('data', function (chunk) { | ||
if ( ! aborted) { | ||
if ( ! aborted) { | ||
request.write(chunk); | ||
@@ -354,2 +354,20 @@ } | ||
/** | ||
* Computes the Content-Length header where applicable | ||
* @param config | ||
* @param file | ||
* @param headers | ||
* @param callback | ||
*/ | ||
var contentLength = function (file, config, method, headers, path, callback) { | ||
fs.stat(file, function (err, stats) { | ||
if (err) { | ||
callback(err); | ||
} else { | ||
headers['content-length'] = stats.size; | ||
headers['authorization'] = authorize(config, method, headers, path); | ||
callback(null, headers); | ||
} | ||
}); | ||
}; | ||
/** | ||
* Returns the standard headers for an S3 request | ||
@@ -379,14 +397,12 @@ * @param config | ||
hdr['content-type'] = res; | ||
fs.stat(body.file, function (err, stats) { | ||
if (err) { | ||
callback(err); | ||
} else { | ||
hdr['content-length'] = stats.size; | ||
hdr.authorization = authorize(config, method, hdr, path); | ||
callback(null, hdr); | ||
} | ||
}); | ||
contentLength(body.file, config, method, hdr, path, callback); | ||
return; | ||
} | ||
}); | ||
return; | ||
} else { | ||
if ( ! hdr['content-length']) { | ||
contentLength(body.file, config, method, hdr, path, callback); | ||
return; | ||
} | ||
} | ||
@@ -393,0 +409,0 @@ } |
{ | ||
"name": "aws2js", | ||
"main": "./lib/aws.js", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"description": "AWS (Amazon Web Services) APIs client implementation for node.js", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
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
68204
44
1746
51