From be9f74125b3a9905367dc740a13f4c9ddb801c61 Mon Sep 17 00:00:00 2001 From: Brian Mcnamara Date: Mon, 4 Jun 2018 16:28:05 -0400 Subject: [PATCH 1/2] Update postToES to include Content-Type header Failure to include the header results in the following error (ES 6.2): { "error": "Content-Type header is missing", "status": 406 } --- ElasticSearchLambda/ZombieWorkshopSearchIndexing.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ElasticSearchLambda/ZombieWorkshopSearchIndexing.js b/ElasticSearchLambda/ZombieWorkshopSearchIndexing.js index 9bf7442..570be67 100644 --- a/ElasticSearchLambda/ZombieWorkshopSearchIndexing.js +++ b/ElasticSearchLambda/ZombieWorkshopSearchIndexing.js @@ -48,6 +48,7 @@ function postToES(doc, context) { req.region = esDomain.region; req.headers['presigned-expires'] = false; req.headers['Host'] = endpoint.host; + req.headers['Content-Type'] = 'application/json' req.body = doc; console.log('Creating the Signer for the post request'); From 31654abb9e3a22f9326d1f2f216e46fa65565782 Mon Sep 17 00:00:00 2001 From: Brian Mcnamara Date: Fri, 8 Jun 2018 12:57:25 -0400 Subject: [PATCH 2/2] Add missing semi-colon --- ElasticSearchLambda/ZombieWorkshopSearchIndexing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElasticSearchLambda/ZombieWorkshopSearchIndexing.js b/ElasticSearchLambda/ZombieWorkshopSearchIndexing.js index 570be67..be02164 100644 --- a/ElasticSearchLambda/ZombieWorkshopSearchIndexing.js +++ b/ElasticSearchLambda/ZombieWorkshopSearchIndexing.js @@ -48,7 +48,7 @@ function postToES(doc, context) { req.region = esDomain.region; req.headers['presigned-expires'] = false; req.headers['Host'] = endpoint.host; - req.headers['Content-Type'] = 'application/json' + req.headers['Content-Type'] = 'application/json'; req.body = doc; console.log('Creating the Signer for the post request');