From 2af110ff62c03a1d11c33209df293e94650bf1a5 Mon Sep 17 00:00:00 2001 From: Nemo D'ACREMONT Date: Sat, 26 Oct 2024 09:42:39 +0200 Subject: [PATCH] feat: only parse json body when content-type is json --- back-end/src/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back-end/src/app.ts b/back-end/src/app.ts index 85c224b..b9d635b 100644 --- a/back-end/src/app.ts +++ b/back-end/src/app.ts @@ -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));