Files
ftb-project-management/apps/server/src/http-body-limit.ts
Script Generator 121114af6a fix(数据): 支持大体积 AppData 并修正默认状态
关键改动:

- 后端显式注册 10mb JSON/urlencoded body parser,支持较大的 AppData 写入

- 前端版本派生数据缺失状态时默认 planned,而不是 released

- 增加请求体限制和版本默认状态测试

Co-Authored-By: Codex GPT-5 <codex@openai.com>
2026-07-02 19:19:43 +08:00

13 lines
379 B
TypeScript

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 }));
}