From 5e020575049baaaae6fff60229fd232ef634e98e Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 14 Apr 2023 13:57:06 +0530 Subject: [PATCH] feat: set max-body size Signed-off-by: Pranav C --- packages/nocodb-nest/src/Noco.ts | 3 +++ packages/nocodb-nest/src/main.ts | 2 ++ packages/nocodb-sdk/src/lib/Api.ts | 8 +++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/nocodb-nest/src/Noco.ts b/packages/nocodb-nest/src/Noco.ts index 1041119134..ca5e2be7aa 100644 --- a/packages/nocodb-nest/src/Noco.ts +++ b/packages/nocodb-nest/src/Noco.ts @@ -98,6 +98,9 @@ export default class Noco { this._server = server; const nestApp = await NestFactory.create(AppModule); + nestApp.use( + express.json({ limit: process.env.NC_REQUEST_BODY_SIZE || '50mb' }), + ); await nestApp.init(); const dashboardPath = process.env.NC_DASHBOARD_URL || '/dashboard'; diff --git a/packages/nocodb-nest/src/main.ts b/packages/nocodb-nest/src/main.ts index cf6812daf7..bcdaaab09c 100644 --- a/packages/nocodb-nest/src/main.ts +++ b/packages/nocodb-nest/src/main.ts @@ -1,9 +1,11 @@ import { NestFactory } from '@nestjs/core'; import cors from 'cors'; +import express from 'express' import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); + app.use(express.json({ limit: process.env.NC_REQUEST_BODY_SIZE || '50mb' })); app.use( cors({ exposedHeaders: 'xc-db-response', diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 2407419a29..b99cf17096 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -154,11 +154,13 @@ export interface AuditType { | 'LINK_RECORD' | 'UNLINK_RECORD' | 'DELETE' - | 'CREATE' - | 'RENAME' + | 'CREATED' + | 'DELETED' + | 'RENAMED' | 'IMPORT_FROM_ZIP' | 'EXPORT_TO_FS' | 'EXPORT_TO_ZIP' + | 'UPDATED' | 'SIGNIN' | 'SIGNUP' | 'PASSWORD_RESET' @@ -7918,7 +7920,7 @@ export class Api< path: `/api/v1/db/public/shared-view/${sharedViewUuid}/rows`, method: 'POST', body: data, - type: ContentType.Json, + type: ContentType.FormData, format: 'json', ...params, }),