Browse Source

Parse as JSON only requests with proper content-type #34

master
Nicola Peduzzi 8 years ago
parent
commit
08ea3caea5
  1. 5
      lib/serve.js

5
lib/serve.js

@ -37,7 +37,10 @@ module.exports = {
_newExpressApp(funcConfs) {
const app = express();
app.use(bodyParser.json({ limit: '5mb' }));
app.use(bodyParser.json({
limit: '5mb',
type: (req) => /json/.test(req.headers['content-type']),
}));
for (let funcConf of funcConfs) {
for (let httpEvent of funcConf.events) {

Loading…
Cancel
Save