Merge pull request #9695 from Budibase/fix/9692

Allow changing the text/json MB limits in app service
This commit is contained in:
Michael Drury 2023-02-14 17:14:35 +00:00 committed by GitHub
commit 8c55cafbd8
2 changed files with 8 additions and 3 deletions

View File

@ -27,13 +27,17 @@ const destroyable = require("server-destroy")
const app = new Koa()
let mbNumber = parseInt(env.HTTP_MB_LIMIT || "10")
if (!mbNumber || isNaN(mbNumber)) {
mbNumber = 10
}
// set up top level koa middleware
app.use(
koaBody({
multipart: true,
formLimit: "10mb",
jsonLimit: "10mb",
textLimit: "10mb",
formLimit: `${mbNumber}mb`,
jsonLimit: `${mbNumber}mb`,
textLimit: `${mbNumber}mb`,
// @ts-ignore
enableTypes: ["json", "form", "text"],
parsedMethods: ["POST", "PUT", "PATCH", "DELETE"],

View File

@ -83,6 +83,7 @@ const environment = {
MULTI_TENANCY: process.env.MULTI_TENANCY,
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
SELF_HOSTED: process.env.SELF_HOSTED,
HTTP_MB_LIMIT: process.env.HTTP_MB_LIMIT,
// old
CLIENT_ID: process.env.CLIENT_ID,
_set(key: string, value: any) {