feat: 加固标题抓取并加上限流与可选入站令牌
This commit is contained in:
@@ -28,6 +28,9 @@ const app = Fastify({
|
||||
redact: ["req.headers.authorization"], // 永不记录密钥
|
||||
},
|
||||
connectionTimeout: 180_000, // 3 min
|
||||
// 安全-03:请求体上限。抓取标题与 AI 任务参数都是小报文,
|
||||
// 没有上限时超大 body 可以打爆内存。
|
||||
bodyLimit: Number(process.env.LPT_AI_BODY_LIMIT_BYTES ?? 256 * 1024),
|
||||
});
|
||||
|
||||
await app.register(aiRoutes);
|
||||
|
||||
Reference in New Issue
Block a user