From 973939546200586027309c98ab21af8c17f051c6 Mon Sep 17 00:00:00 2001 From: Nikody Keating Date: Tue, 7 Jul 2020 10:51:23 -0700 Subject: [PATCH 1/4] Update AmazonConnection.js --- src/AmazonConnection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AmazonConnection.js b/src/AmazonConnection.js index 8e95ed9..e988182 100644 --- a/src/AmazonConnection.js +++ b/src/AmazonConnection.js @@ -14,7 +14,7 @@ module.exports = awsConfig => { // Fix the Host header, since HttpConnector.makeReqParams() appends // the port number which will cause signature verification to fail - req.headers.host = req.hostname + req.headers.Host = req.hostname if (params.body) { req.headers['content-length'] = Buffer.byteLength(params.body, 'utf8') From 9df74799e92c010b98bdf0dd62850813013ddceb Mon Sep 17 00:00:00 2001 From: Nikody Keating Date: Tue, 7 Jul 2020 10:56:44 -0700 Subject: [PATCH 2/4] Update AmazonConnection.test.js --- tests/AmazonConnection.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AmazonConnection.test.js b/tests/AmazonConnection.test.js index b16c420..a6be9cb 100644 --- a/tests/AmazonConnection.test.js +++ b/tests/AmazonConnection.test.js @@ -32,7 +32,7 @@ describe('AmazonConnection', function () { headers: {} }) - assert.strictEqual(req.headers.host, 'foo.us-east-1.es.amazonaws.com') + assert.strictEqual(req.headers.Host, 'foo.us-east-1.es.amazonaws.com') }) it('sets the content-length: 0 header when there is no body', function () { From 0edd32766044e95c731e4c7338bdaecbc54cb0e3 Mon Sep 17 00:00:00 2001 From: Nikody Keating Date: Tue, 7 Jul 2020 11:08:51 -0700 Subject: [PATCH 3/4] Update AmazonConnection.js --- src/AmazonConnection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/AmazonConnection.js b/src/AmazonConnection.js index e988182..2d98eb7 100644 --- a/src/AmazonConnection.js +++ b/src/AmazonConnection.js @@ -14,7 +14,10 @@ module.exports = awsConfig => { // Fix the Host header, since HttpConnector.makeReqParams() appends // the port number which will cause signature verification to fail - req.headers.Host = req.hostname + req.headers.host = req.hostname + if(req.headers.Host) { + delete req.headers.Host; + } if (params.body) { req.headers['content-length'] = Buffer.byteLength(params.body, 'utf8') From e6556a7e51efd6983752d5e9001c9fbe3e66e167 Mon Sep 17 00:00:00 2001 From: Nikody Keating Date: Tue, 7 Jul 2020 11:15:02 -0700 Subject: [PATCH 4/4] Update AmazonConnection.test.js --- tests/AmazonConnection.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AmazonConnection.test.js b/tests/AmazonConnection.test.js index a6be9cb..b16c420 100644 --- a/tests/AmazonConnection.test.js +++ b/tests/AmazonConnection.test.js @@ -32,7 +32,7 @@ describe('AmazonConnection', function () { headers: {} }) - assert.strictEqual(req.headers.Host, 'foo.us-east-1.es.amazonaws.com') + assert.strictEqual(req.headers.host, 'foo.us-east-1.es.amazonaws.com') }) it('sets the content-length: 0 header when there is no body', function () {