Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws2js

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws2js - npm Package Compare versions

Comparing version 0.5.5 to 0.5.6

tests/s3-put-png-with-manual-content-type.js

3

CHANGELOG.md

@@ -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.

36

lib/internals.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc