Comparing version 1.5.0 to 1.6.0
21
aws4.js
@@ -121,10 +121,10 @@ var aws4 = exports, | ||
if (this.credentials.sessionToken) | ||
if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) | ||
headers['X-Amz-Security-Token'] = this.credentials.sessionToken | ||
if (this.service === 's3') | ||
if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) | ||
headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') | ||
if (headers['X-Amz-Date']) | ||
this.datetime = headers['X-Amz-Date'] | ||
if (headers['X-Amz-Date'] || headers['x-amz-date']) | ||
this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] | ||
else | ||
@@ -206,2 +206,3 @@ headers['X-Amz-Date'] = this.getDateTime() | ||
query = this.parsedPath.query, | ||
headers = this.request.headers, | ||
queryStr = '', | ||
@@ -212,5 +213,13 @@ normalizePath = this.service !== 's3', | ||
firstValOnly = this.service === 's3', | ||
bodyHash = this.service === 's3' && this.request.signQuery ? 'UNSIGNED-PAYLOAD' : | ||
(this.isCodeCommitGit ? '' : hash(this.request.body || '', 'hex')) | ||
bodyHash | ||
if (this.service === 's3' && this.request.signQuery) { | ||
bodyHash = 'UNSIGNED-PAYLOAD' | ||
} else if (this.isCodeCommitGit) { | ||
bodyHash = '' | ||
} else { | ||
bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || | ||
hash(this.request.body || '', 'hex') | ||
} | ||
if (query) { | ||
@@ -217,0 +226,0 @@ queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { |
{ | ||
"name": "aws4", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "Signs and prepares requests using AWS Signature Version 4", | ||
@@ -5,0 +5,0 @@ "author": "Michael Hart <michael.hart.au@gmail.com> (http://github.com/mhart)", |
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
31958
349