Comparing version
@@ -72,3 +72,3 @@ var aws2 = exports | ||
;delete params['Signature'] | ||
delete params['Signature'] | ||
params['Signature'] = this.signature() | ||
@@ -78,6 +78,8 @@ | ||
if (request.body) | ||
if (request.body) { | ||
request.body = query | ||
else | ||
headers['Content-Length'] = Buffer.byteLength(request.body) | ||
} else { | ||
request.path = pathParts[0] + '?' + query | ||
} | ||
@@ -84,0 +86,0 @@ return request |
{ | ||
"name": "aws2", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Signs and prepares requests using AWS Signature Version 2", | ||
@@ -5,0 +5,0 @@ "author": "Michael Hart <michael.hart.au@gmail.com> (http://github.com/mhart)", |
@@ -9,2 +9,12 @@ aws2 | ||
This signature is supported by a number of Amazon services, including | ||
[SNS](http://docs.aws.amazon.com/sns/latest/api/), | ||
[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/), | ||
[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/), | ||
[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/), | ||
[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/), | ||
[Elastic MapReduce](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/), | ||
[ImportExport](http://docs.aws.amazon.com/AWSImportExport/latest/API/) and | ||
[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html). | ||
It also provides defaults for a number of core AWS headers and | ||
@@ -127,3 +137,3 @@ request parameters, making it a very easy to query AWS services, or | ||
This calculates and populates the `Signature` param of either | ||
`requestOptions.path` or requestOptions.body` depending on whether it is | ||
`requestOptions.path` or `requestOptions.body` depending on whether it is | ||
a `GET` or `POST` request. Returns `requestOptions` as a convenience for | ||
@@ -130,0 +140,0 @@ chaining. |
18577
4.09%271
0.74%189
5.59%