Skip to content

Commit

Permalink
fix: Fix S3 2.1 Event Identification (#35)
Browse files Browse the repository at this point in the history
Closes #34
  • Loading branch information
kolanos authored May 7, 2019
1 parent dfdbc18 commit c90c751
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
yarn-error.log
4 changes: 3 additions & 1 deletion src/plugins/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit c90c751

Please sign in to comment.