mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 03:56:23 +08:00
fix: raw body limit (#10254)
This commit is contained in:
@@ -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,
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user