Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function defaultJsonParser (req, body, done) {
if (body === '' || body == null) {
return done(new FST_ERR_CTP_EMPTY_JSON_BODY(), undefined)
}
try {
var json = secureJson.parse(body, { protoAction: onProtoPoisoning })
} catch (err) {
err.statusCode = 400
return done(err, undefined)
}
done(null, json)
}
}