expressa 2.0.23 → 2.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -215,7 +215,14 @@ module.exports.api = function (settings) {
215
215
  })
216
216
 
217
217
  router.use(bodyParser.json({
218
- type: '*/*', // The wildcard type ensures it works even without the application/json header
218
+ type: (req) => {
219
+ const contentType = req.headers['content-type'] || ''
220
+ // Don't parse any multipart/* content - body-parser can't handle these
221
+ if (contentType.startsWith('multipart/')) {
222
+ return false
223
+ }
224
+ return true
225
+ },
219
226
  limit: router.settings.body_limit || '1mb',
220
227
  }))
221
228
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expressa",
3
- "version": "2.0.23",
3
+ "version": "2.0.24",
4
4
  "description": "API framework using JSON schemas",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/thomas4019/expressa",