[vercel] fix: return 3xx responses when redirect is manual in client.fetch() (#15953)
## Summary - `client.fetch()` now returns 3xx responses directly when `redirect: 'manual'` is passed, instead of entering the error/retry path - This is opt-in — no existing behavior changes since no code currently passes `redirect: 'manual'` through `client.fetch()` ## Why This enables CLI commands that need to extract `Location` headers from redirect-based API endpoints (e.g., endpoints that initialize server-side state and redirect to a browser URL). Today, the 3xx response hits `!res.ok` (302 is outside 200-299), doesn't match the 400-499 bail condition, and falls through to `throw error` — causing infinite retries. ## Test plan - [x] New test: 302 with `redirect: 'manual'` returns raw response with Location header - [x] New test: 302 without `redirect: 'manual'` follows the redirect (default behavior unchanged) - [x] Existing proxy test still passes 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
B
Bhrigu Srivastava committed
fc5a29de2d7ddc31ca395d4a31eef6d0830cd368
Parent: 0806a28
Committed by GitHub <noreply@github.com>
on 4/15/2026, 12:01:54 AM