@middy/http-multipart-body-parser
Advanced tools
Comparing version 4.6.1 to 4.6.2
@@ -6,2 +6,3 @@ import BusBoy from 'busboy'; | ||
const defaults = { | ||
// busboy options as per documentation: https://www.npmjs.com/package/busboy#busboy-methods | ||
busboy: {}, | ||
@@ -18,3 +19,3 @@ charset: 'utf8', | ||
const { headers } = request.event; | ||
const contentType = headers['Content-Type'] ?? headers['content-type']; | ||
const contentType = headers?.['Content-Type'] ?? headers?.['content-type']; | ||
if (!mimePattern.test(contentType)) { | ||
@@ -29,4 +30,6 @@ if (options.disableContentTypeError) { | ||
return parseMultipartData(request.event, options).then((multipartData)=>{ | ||
// request.event.rawBody = body | ||
request.event.body = multipartData; | ||
}).catch((cause)=>{ | ||
// UnprocessableEntity | ||
throw createError(415, 'Invalid or malformed multipart/form-data was provided', { | ||
@@ -44,2 +47,3 @@ cause | ||
const charset = event.isBase64Encoded ? 'base64' : options.charset; | ||
// header must be lowercase (content-type) | ||
const busboy = BusBoy({ | ||
@@ -46,0 +50,0 @@ ...options.busboy, |
{ | ||
"name": "@middy/http-multipart-body-parser", | ||
"version": "4.6.1", | ||
"version": "4.6.2", | ||
"description": "Http event normalizer middleware for the middy framework", | ||
@@ -69,11 +69,11 @@ "type": "module", | ||
"dependencies": { | ||
"@middy/util": "4.6.1", | ||
"@middy/util": "4.6.2", | ||
"busboy": "1.6.0" | ||
}, | ||
"devDependencies": { | ||
"@middy/core": "4.6.1", | ||
"@middy/core": "4.6.2", | ||
"@types/aws-lambda": "^8.10.101", | ||
"type-fest": "^4.0.0" | ||
}, | ||
"gitHead": "253ed0e4ca95623decbade03938a07d837a1eba2" | ||
"gitHead": "8b03a01abf5a9c08231ec5ced775e87f8be8f67d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17306
330
32
+ Added@middy/util@4.6.2(transitive)
- Removed@middy/util@4.6.1(transitive)
Updated@middy/util@4.6.2