From ea17e56af1978b1172b3fbf21109baf760807ceb Mon Sep 17 00:00:00 2001 From: Tan Zhen Yong Date: Tue, 2 Nov 2021 15:00:01 +0800 Subject: [PATCH] fix: correct regex for encoding binary types `application/*` types excluded from base64 encoding is based on the list in https://answers.netlify.com/t/changed-behavior-in-function-body-encoding/19000. --- src/lib/functions/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/functions/utils.js b/src/lib/functions/utils.js index 39d4e842372..ebcfb89b9a2 100644 --- a/src/lib/functions/utils.js +++ b/src/lib/functions/utils.js @@ -3,7 +3,8 @@ const chalk = require('chalk') const { warn } = require('../../utils/command-helpers') const { getLogMessage } = require('../log') -const BASE_64_MIME_REGEXP = /image|audio|video|application\/pdf|application\/zip|applicaton\/octet-stream/i +const BASE_64_MIME_REGEXP = + /image|audio|video|application\/(?!json|xml|javascript|csp-report|graphql|x-www-form-urlencoded|x-ndjson)/i const DEFAULT_LAMBDA_OPTIONS = { verboseLevel: 3,