From 74155d3d0a0db90e17589bcfc846e2b605762f13 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Tue, 10 Mar 2026 19:04:04 -0700 Subject: [PATCH] Strip accept-encoding to prevent gzip in proxy chain Toes' Bun fetch auto-decompresses responses. If Go sends gzip through our proxy, toes gets raw gzip bytes it can't handle. Stripping accept-encoding tells Go to send uncompressed. Co-Authored-By: Claude Opus 4.6 --- src/proxy.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/proxy.ts b/src/proxy.ts index 8c5f59b..b78d555 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -20,13 +20,14 @@ export function createProxy(socketPath: string, isHealthy: () => boolean, isRunn const hasBody = req.method !== 'GET' && req.method !== 'HEAD' const body = hasBody ? await req.arrayBuffer() : undefined + const headers = new Headers(req.headers) + headers.delete('accept-encoding') return fetch(`http://localhost${url.pathname}${url.search}`, { method: req.method, - headers: req.headers, + headers, body, unix: socketPath, - decompress: false, }).catch((e) => { console.error('Proxy error:', e) return new Response('Tronbyt server is not responding', { status: 502 })