fix: raw body limit (#10254)

This commit is contained in:
darkskygit
2025-02-18 11:34:58 +00:00
parent 4c7eedb920
commit 176e0a1950
5 changed files with 86 additions and 6 deletions
@@ -19,6 +19,8 @@ interface TestingAppMetadata extends ModuleMetadata {
export type TestUser = Omit<User, 'password'> & { password: string };
const OneMB = 1024 * 1024;
export async function createTestingApp(
moduleDef: TestingAppMetadata = {}
): Promise<TestingApp> {
@@ -30,7 +32,7 @@ export async function createTestingApp(
rawBody: true,
});
app.useBodyParser('raw');
app.useBodyParser('raw', { limit: 1 * OneMB });
const logger = new AFFiNELogger();
@@ -40,7 +42,7 @@ export async function createTestingApp(
app.useGlobalFilters(new GlobalExceptionFilter(app.getHttpAdapter()));
app.use(
graphqlUploadExpress({
maxFileSize: 10 * 1024 * 1024,
maxFileSize: 10 * OneMB,
maxFiles: 5,
})
);