关键改动: - 后端显式注册 10mb JSON/urlencoded body parser,支持较大的 AppData 写入 - 前端版本派生数据缺失状态时默认 planned,而不是 released - 增加请求体限制和版本默认状态测试 Co-Authored-By: Codex GPT-5 <codex@openai.com>
13 lines
379 B
TypeScript
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 }));
|
|
}
|