correctly set limit

This commit is contained in:
Phillip Thelen
2023-03-02 18:04:02 +01:00
parent 5d1346e65c
commit 0754c0ff05

View File

@@ -72,6 +72,7 @@ export default function attachMiddlewares (app, server) {
app.use(bodyParser.urlencoded({
extended: true, // Uses 'qs' library as old connect middleware
limit: '10mb',
}));
app.use(function bodyMiddleware (req, res, next) { // eslint-disable-line prefer-arrow-callback
if (req.path === '/stripe/webhooks') {
@@ -79,7 +80,7 @@ export default function attachMiddlewares (app, server) {
// See https://stripe.com/docs/webhooks/signatures#verify-official-libraries
bodyParser.raw({ type: 'application/json' })(req, res, next);
} else {
bodyParser.json()(req, res, next);
bodyParser.json({ limit: '10mb' })(req, res, next);
}
});