From 8e3af9ac158bd9258d1fdf2e2ede5f79e29cdae7 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Fri, 11 Feb 2022 23:38:34 -0500 Subject: [PATCH] feat: use config value for json body parser limit --- config.sample.yml | 8 ++++++++ server/app/data.yml | 1 + server/master.js | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config.sample.yml b/config.sample.yml index 316dd603..6f4fbdf3 100644 --- a/config.sample.yml +++ b/config.sample.yml @@ -130,3 +130,11 @@ ha: false # --------------------------------------------------------------------- # Writeable data path used for cache and temporary user uploads. dataPath: ./data + +# --------------------------------------------------------------------- +# Body Parser Limit +# --------------------------------------------------------------------- +# Maximum size of API requests body that can be parsed. Does not affect +# file uploads. + +bodyParserLimit: 5mb diff --git a/server/app/data.yml b/server/app/data.yml index 0e5e45e2..e80b43d6 100644 --- a/server/app/data.yml +++ b/server/app/data.yml @@ -26,6 +26,7 @@ defaults: logLevel: info offline: false ha: false + bodyParserLimit: 5mb # DB defaults api: isEnabled: false diff --git a/server/master.js b/server/master.js index fea5e34a..a1205abd 100644 --- a/server/master.js +++ b/server/master.js @@ -91,7 +91,7 @@ module.exports = async () => { // GraphQL Server // ---------------------------------------- - app.use(bodyParser.json({ limit: '1mb' })) + app.use(bodyParser.json({ limit: WIKI.config.bodyParserLimit })) await WIKI.servers.startGraphQL() // ----------------------------------------