13 Commits

Author SHA1 Message Date
t0ng7u
c2ed76ddfd 🛡️ fix: prevent OOM on large/decompressed requests; skip heavy prompt meta when token count is disabled
Clamp request body size (including post-decompression) to avoid memory exhaustion caused by huge payloads/zip bombs, especially with large-context Claude requests. Add a configurable `MAX_REQUEST_BODY_MB` (default `32`) and document it.

- Enforce max request body size after gzip/br decompression via `http.MaxBytesReader`
- Add a secondary size guard in `common.GetRequestBody` and cache-safe handling
- Return **413 Request Entity Too Large** on oversized bodies in relay entry
- Avoid building large `TokenCountMeta.CombineText` when both token counting and sensitive check are disabled (use lightweight meta for pricing)
- Update READMEs (CN/EN/FR/JA) with `MAX_REQUEST_BODY_MB`
- Fix a handful of vet/formatting issues encountered during the change
- `go test ./...` passes
2025-12-16 17:00:19 +08:00
StageDog
cf8d4e874d feat: 针对 discord 登录配置使用新版设置方案 2025-11-22 19:06:53 +08:00
Seefs
5010f2d004 format: package name -> github.com/QuantumNous/new-api (#2017) 2025-10-11 15:30:09 +08:00
Seefs
56ffbd57b9 fix: legal setting 2025-10-10 13:18:26 +08:00
Seefs
ce1f62b27c fix: passkey 文案 2025-09-30 16:15:33 +08:00
Seefs
75ee632182 fix: passkey rpid detect 2025-09-30 15:53:19 +08:00
Seefs
1599a8403f feat: passkey 2025-09-29 17:45:09 +08:00
CaIon
0008d2e3a0 feat: add experimental IP filtering for domains and update related settings 2025-09-18 13:40:52 +08:00
creamlike1024
82163b4be7 feat: 添加域名启用ip过滤开关 2025-09-17 23:46:04 +08:00
creamlike1024
cc9a559b75 feat: 添加域名和ip过滤模式设置 2025-09-16 22:40:40 +08:00
CaIon
c3f5478593 feat: implement SSRF protection settings and update related references 2025-09-13 18:15:03 +08:00
CaIon
9e17df3f74 fix: update references from setting to system_setting for ServerAddress 2025-09-13 15:27:41 +08:00
1808837298@qq.com
9f3cc03508 refactor: Migrate OIDC configuration to system settings 2025-03-11 22:00:31 +08:00