From b2c54dc7507736b41e3e0a6d140f52b0f9fa9018 Mon Sep 17 00:00:00 2001 From: Tony Knight Date: Thu, 25 Jan 2018 10:46:41 -0500 Subject: [PATCH 1/2] forward slash support needed in file name --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7fc75e7..c06faea 100644 --- a/index.js +++ b/index.js @@ -18,9 +18,9 @@ module.exports.parse = (event) => { ] = { type: 'file', filename: item - .match(/filename="[\w-\.]+"/)[0] + .match(/filename="[\w-\.\/]+"/)[0] .split('=')[1] - .match(/[\w-\.]+/)[0], + .match(/[\w-\.\/]+/)[0], contentType: item .match(/Content-Type: .+\r\n\r\n/)[0] .replace(/Content-Type: /, '') From f7f3b4668841ab582a5b490902dacafcc9493574 Mon Sep 17 00:00:00 2001 From: Tony Knight Date: Thu, 25 Jan 2018 14:14:07 -0500 Subject: [PATCH 2/2] latin1 encoding fixed error with buffer contents --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c06faea..6ad8439 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ module.exports.parse = (event) => { .replace(/\r\n\r\n/, ''), content: Buffer.from(item .split(/\r\n\r\n/)[1] - .replace(/\r\n\r\n\r\n--/, '')), + .replace(/(\r\n)+--/, ''), 'latin1'), }; return result; }