fix(数据): 支持大体积 AppData 并修正默认状态
关键改动: - 后端显式注册 10mb JSON/urlencoded body parser,支持较大的 AppData 写入 - 前端版本派生数据缺失状态时默认 planned,而不是 released - 增加请求体限制和版本默认状态测试 Co-Authored-By: Codex GPT-5 <codex@openai.com>
This commit is contained in:
12
apps/server/src/http-body-limit.ts
Normal file
12
apps/server/src/http-body-limit.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { INestApplication } from '@nestjs/common';
|
||||
import { json, urlencoded } from 'express';
|
||||
|
||||
export const DEFAULT_HTTP_BODY_LIMIT = '10mb';
|
||||
|
||||
export function configureHttpBodyParsers(
|
||||
app: Pick<INestApplication, 'use'>,
|
||||
limit = process.env.HTTP_BODY_LIMIT || DEFAULT_HTTP_BODY_LIMIT,
|
||||
) {
|
||||
app.use(json({ limit }));
|
||||
app.use(urlencoded({ extended: true, limit }));
|
||||
}
|
||||
Reference in New Issue
Block a user