From a71047a03bc03eeb3fd277b6beaf2f5515de2b30 Mon Sep 17 00:00:00 2001 From: Michael Lavers Date: Tue, 7 May 2019 08:03:13 -0700 Subject: [PATCH] fix: Fix S3 2.1 Event Identification Closes #34 --- .gitignore | 1 + src/plugins/s3.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f06235c..1ca025f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules dist +yarn-error.log diff --git a/src/plugins/s3.js b/src/plugins/s3.js index e9a3510..730e2b2 100644 --- a/src/plugins/s3.js +++ b/src/plugins/s3.js @@ -6,7 +6,9 @@ function eventType(event = {}) { const { Records = [] } = event; const [firstEvent = {}] = Records; const { eventVersion, eventSource } = firstEvent; - return eventVersion === '2.0' && eventSource === 'aws:s3' ? type : false; + return ['2.0', '2.1'].indexOf(eventVersion) !== -1 && eventSource === 'aws:s3' + ? type + : false; } const keys = [