Increase webhooks payload limit

This commit is contained in:
Gene Hazan 2018-09-24 13:36:19 -07:00
Родитель 0753a01fff
Коммит f40c5559ad
1 изменённых файлов: 2 добавлений и 2 удалений

4
app.js
Просмотреть файл

@ -22,8 +22,8 @@ app.use(logger('dev'));
app.use(sendHelper());
// If we should be listening for webhooks, add the route before the json body parser so we get the raw bodies.
// Note also that the GitHub doc says events are capped at 5mb
app.use('/webhook', bodyParser.raw({ limit: '5mb', type: '*/*' }), require('./routes/webhook')(service, config.get('CRAWLER_WEBHOOK_SECRET')));
// Note also that the GitHub doc says events are capped at 25mb
app.use('/webhook', bodyParser.raw({ limit: '25mb', type: '*/*' }), require('./routes/webhook')(service, config.get('CRAWLER_WEBHOOK_SECRET')));
// It's safe to set limitation to 2mb.
app.use(bodyParser.json({ limit: '2mb' , strict: false}));
app.use('/status', require('./routes/status')(service));