🛡 ️ 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
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| auth.go | Loading commit data... | |
| cache.go | Loading commit data... | |
| cors.go | Loading commit data... | |
| disable-cache.go | Loading commit data... | |
| distributor.go | Loading commit data... | |
| email-verification-rate-limit.go | Loading commit data... | |
| gzip.go | Loading commit data... | |
| jimeng_adapter.go | Loading commit data... | |
| kling_adapter.go | Loading commit data... | |
| logger.go | Loading commit data... | |
| model-rate-limit.go | Loading commit data... | |
| rate-limit.go | Loading commit data... | |
| recover.go | Loading commit data... | |
| request-id.go | Loading commit data... | |
| secure_verification.go | Loading commit data... | |
| stats.go | Loading commit data... | |
| turnstile-check.go | Loading commit data... | |
| utils.go | Loading commit data... |