Add 3GB file size limit to body parser middlewares (#2390)

This commit is contained in:
Blazej Owczarczyk 2024-09-30 20:19:41 +02:00 committed by GitHub
parent e07535471f
commit 348d9c8285
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
})
);