From 348d9c828565a56ae9b9e496171e06dd98f5981f Mon Sep 17 00:00:00 2001 From: Blazej Owczarczyk Date: Mon, 30 Sep 2024 20:19:41 +0200 Subject: [PATCH] Add 3GB file size limit to body parser middlewares (#2390) --- collector/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/collector/index.js b/collector/index.js index 2893754af..7c41002da 100644 --- a/collector/index.js +++ b/collector/index.js @@ -16,12 +16,14 @@ const extensions = require("./extensions"); const { processRawText } = require("./processRawText"); const { verifyPayloadIntegrity } = require("./middleware/verifyIntegrity"); const app = express(); +const FILE_LIMIT = "3GB"; app.use(cors({ origin: true })); app.use( - bodyParser.text(), - bodyParser.json(), + bodyParser.text({ limit: FILE_LIMIT }), + bodyParser.json({ limit: FILE_LIMIT }), bodyParser.urlencoded({ + limit: FILE_LIMIT, extended: true, }) );