From 3fe4116ec729d6b88c10235607acdbaa490658e0 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Tue, 10 Mar 2026 17:36:24 -0700 Subject: [PATCH] Strip accept-encoding to avoid ZlibError in proxy chain The Go server returns gzip responses, but when Bun proxies these through to the toes proxy, the double-proxy causes a ZlibError during decompression. Stripping accept-encoding tells the Go server to send uncompressed responses. Co-Authored-By: Claude Opus 4.6 --- src/server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server.ts b/src/server.ts index 1c88719..2ed86cf 100644 --- a/src/server.ts +++ b/src/server.ts @@ -30,10 +30,12 @@ function proxyFetch(req: Request): Promise | Response { } const hasBody = req.method !== 'GET' && req.method !== 'HEAD' + 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: hasBody ? req.body : undefined, unix: SOCKET_PATH, }).catch((e) => {