Comparing version 1.2.1 to 1.3.1
11
aws4.js
@@ -46,4 +46,9 @@ var aws4 = exports, | ||
if (!headers.Host && !headers.host) | ||
if (!headers.Host && !headers.host) { | ||
headers.Host = request.hostname || request.host || this.createHost() | ||
// If a port is specified explicitly, use it as is | ||
if (request.port) | ||
headers.Host += ':' + request.port | ||
} | ||
if (!request.hostname && !request.host) | ||
@@ -214,4 +219,3 @@ request.hostname = headers.Host || headers.host | ||
if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') | ||
if (pathStr[0] === '/') pathStr = pathStr.slice(1) | ||
pathStr = '/' + pathStr.split('/').reduce(function(path, piece) { | ||
pathStr = pathStr.split('/').reduce(function(path, piece) { | ||
if (normalizePath && piece === '..') { | ||
@@ -225,2 +229,3 @@ path.pop() | ||
}, []).join('/') | ||
if (pathStr[0] !== '/') pathStr = '/' + pathStr | ||
if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') | ||
@@ -227,0 +232,0 @@ } |
{ | ||
"name": "aws4", | ||
"version": "1.2.1", | ||
"version": "1.3.1", | ||
"description": "Signs and prepares requests using AWS Signature Version 4", | ||
@@ -65,7 +65,7 @@ "author": "Michael Hart <michael.hart.au@gmail.com> (http://github.com/mhart)", | ||
"dependencies": { | ||
"lru-cache": "^2.6.5" | ||
"lru-cache": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.2.5", | ||
"should": "^7.0.1" | ||
"mocha": "^2.4.5", | ||
"should": "^8.2.2" | ||
}, | ||
@@ -72,0 +72,0 @@ "scripts": { |
38982
574
+ Addedlru-cache@4.1.5(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedyallist@2.1.2(transitive)
- Removedlru-cache@2.7.3(transitive)
Updatedlru-cache@^4.0.0