Quick fix to add the ability to update the app-service HTTP MB max limits.
This commit is contained in:
parent
aaa8903b20
commit
015f95aa6d
|
@ -27,13 +27,17 @@ const destroyable = require("server-destroy")
|
||||||
|
|
||||||
const app = new Koa()
|
const app = new Koa()
|
||||||
|
|
||||||
|
let mbNumber = parseInt(env.HTTP_MB_LIMIT || "10")
|
||||||
|
if (!mbNumber || isNaN(mbNumber)) {
|
||||||
|
mbNumber = 10
|
||||||
|
}
|
||||||
// set up top level koa middleware
|
// set up top level koa middleware
|
||||||
app.use(
|
app.use(
|
||||||
koaBody({
|
koaBody({
|
||||||
multipart: true,
|
multipart: true,
|
||||||
formLimit: "10mb",
|
formLimit: `${mbNumber}mb`,
|
||||||
jsonLimit: "10mb",
|
jsonLimit: `${mbNumber}mb`,
|
||||||
textLimit: "10mb",
|
textLimit: `${mbNumber}mb`,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
enableTypes: ["json", "form", "text"],
|
enableTypes: ["json", "form", "text"],
|
||||||
parsedMethods: ["POST", "PUT", "PATCH", "DELETE"],
|
parsedMethods: ["POST", "PUT", "PATCH", "DELETE"],
|
||||||
|
|
|
@ -83,6 +83,7 @@ const environment = {
|
||||||
MULTI_TENANCY: process.env.MULTI_TENANCY,
|
MULTI_TENANCY: process.env.MULTI_TENANCY,
|
||||||
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
|
ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS,
|
||||||
SELF_HOSTED: process.env.SELF_HOSTED,
|
SELF_HOSTED: process.env.SELF_HOSTED,
|
||||||
|
HTTP_MB_LIMIT: process.env.HTTP_MB_LIMIT,
|
||||||
// old
|
// old
|
||||||
CLIENT_ID: process.env.CLIENT_ID,
|
CLIENT_ID: process.env.CLIENT_ID,
|
||||||
_set(key: string, value: any) {
|
_set(key: string, value: any) {
|
||||||
|
|
Loading…
Reference in New Issue