fix: Include maximum import size
This commit is contained in:
@@ -30,7 +30,12 @@ router.post(
|
|||||||
rateLimiter(RateLimiterStrategy.TenPerMinute),
|
rateLimiter(RateLimiterStrategy.TenPerMinute),
|
||||||
auth(),
|
auth(),
|
||||||
validate(T.FilesCreateSchema),
|
validate(T.FilesCreateSchema),
|
||||||
multipart({ maximumFileSize: env.FILE_STORAGE_UPLOAD_MAX_SIZE }),
|
multipart({
|
||||||
|
maximumFileSize: Math.max(
|
||||||
|
env.FILE_STORAGE_UPLOAD_MAX_SIZE,
|
||||||
|
env.MAXIMUM_IMPORT_SIZE
|
||||||
|
),
|
||||||
|
}),
|
||||||
async (ctx: APIContext<T.FilesCreateReq>) => {
|
async (ctx: APIContext<T.FilesCreateReq>) => {
|
||||||
const actor = ctx.state.auth.user;
|
const actor = ctx.state.auth.user;
|
||||||
const { key } = ctx.input.body;
|
const { key } = ctx.input.body;
|
||||||
|
|||||||
@@ -44,7 +44,10 @@ api.use(
|
|||||||
bodyParser({
|
bodyParser({
|
||||||
multipart: true,
|
multipart: true,
|
||||||
formidable: {
|
formidable: {
|
||||||
maxFileSize: env.FILE_STORAGE_UPLOAD_MAX_SIZE,
|
maxFileSize: Math.max(
|
||||||
|
env.FILE_STORAGE_UPLOAD_MAX_SIZE,
|
||||||
|
env.MAXIMUM_IMPORT_SIZE
|
||||||
|
),
|
||||||
maxFieldsSize: 10 * 1024 * 1024,
|
maxFieldsSize: 10 * 1024 * 1024,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user