feat: only parse json body when content-type is json

This commit is contained in:
Nemo D'ACREMONT 2024-10-26 09:42:39 +02:00
parent 96abcb9db0
commit 2af110ff62
No known key found for this signature in database
GPG Key ID: 6E5BCE8022FA8276

View File

@ -21,7 +21,7 @@ console.log("=== END LOG CONFIG ===");
app.set('views', path.join(__dirname, 'templates'));
app.set('view engine', 'ejs');
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json({ limit: '50mb' }));
app.use(bodyParser.json({ limit: '50mb', type: 'application/*+json' }));
// Add logs
app.use(morgan(log_format));