fix: 审查修复 — 来源字段长度限制、鉴权超时、支付配置启动校验

- src_host max 253, src_url max 2048
- Sub2API 鉴权请求加 5s AbortController 超时
- initPaymentProviders 启动时校验 ENABLED_PAYMENT_TYPES 与已注册 provider 一致性

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erio
2026-03-03 01:56:22 +08:00
parent 8cf78dc295
commit 930ce60fcc
3 changed files with 16 additions and 2 deletions

View File

@@ -7,8 +7,8 @@ const createOrderSchema = z.object({
user_id: z.number().int().positive(),
amount: z.number().positive(),
payment_type: z.enum(['alipay', 'wxpay', 'stripe']),
src_host: z.string().optional(),
src_url: z.string().optional(),
src_host: z.string().max(253).optional(),
src_url: z.string().max(2048).optional(),
});
export async function POST(request: NextRequest) {