Use redirect: manual to let browser handle redirects

Bun's fetch was following Go's 303 redirects internally, which
caused ECONNRESET errors during the auto-login redirect chain.
Let the browser handle redirects instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Corey Johnson 2026-03-10 19:36:13 -07:00
parent 383f6a8143
commit 869fd18d42

View File

@ -28,6 +28,7 @@ export function createProxy(isHealthy: () => boolean, isRunning: () => boolean)
method: req.method, method: req.method,
headers: req.headers, headers: req.headers,
body, body,
redirect: 'manual',
}).then((r) => { }).then((r) => {
// Bun auto-decompresses gzip but leaves content-encoding header. // Bun auto-decompresses gzip but leaves content-encoding header.
// Strip it so the next proxy layer doesn't try to decompress again. // Strip it so the next proxy layer doesn't try to decompress again.