mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-11-27 12:22:43 +08:00
- Bound response body reads with io.LimitReader in FetchProjectID and OnboardUser (1 MiB for 2xx JSON payloads and 64 KiB for non-2xx error bodies) and cap HTTPStatusError messages at 8 KiB on valid UTF-8 boundaries instead of slicing OnboardUser errors at 200 raw bytes. - Replace the uninterruptible 2-second time.Sleep in OnboardUser polling with a context-aware timer select, skip the trailing sleep after the final attempt, and normalize nil contexts safely. - Add race-tested regression tests in internal/auth/antigravity/auth_test.go covering structured 403/429 error preservation, UTF-8 boundary truncation, immediate polling cancellation via synctest, and response body read limits. Closes: #7759