From a3a4e82078cde35e4477971ab4499f42ad8dcab2 Mon Sep 17 00:00:00 2001 From: Darius Davis Date: Fri, 28 Sep 2018 10:10:20 -0500 Subject: [PATCH] Decode event body from BASE 64 --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index aa5c684..764cf50 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,11 @@ function getBoundary(event) { module.exports.parse = (event, spotText) => { const boundary = getBoundary(event); const result = {}; - event.body + // Decode body from BASE64 + const data = event.body; + const buff = new Buffer(data, 'base64'); + const eventBody = buff.toString('ascii'); + eventBody .split(boundary) .forEach(item => { if (/filename=".+"/g.test(item)) {