Skip to content

Fix empty response bodies through the web proxy - #9

Merged
ralyodio merged 1 commit into
mainfrom
fix/proxy-content-encoding
Aug 11, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/proxy-content-encoding

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The landing page returned 200 with a zero-byte body in production.

HTTP/2 200
content-type: text/html; charset=utf-8
--- body bytes --- 0

Cause

fetch transparently decompresses what it receives, but the supervisor forwarded the Next child response headers unchanged — including content-encoding: gzip. The response then claimed to be gzipped while carrying plain bytes, so the client decoded it to nothing.

Only the landing page showed it: API paths are served in-process and never touch the proxy, and /today was a redirect with no body.

The proxy now requests identity encoding from the child over loopback (compression there buys nothing) and strips content-encoding, content-length and transfer-encoding from the response it returns — those describe the child wire format, not the one being sent onward.

Why CI passed

Plain curl sends no Accept-Encoding, so the child never compressed and the mismatch never arose. Every browser sends it.

The landing check now uses curl --compressed and asserts a body over 1000 bytes, so a 200-with-no-content fails the build. It also checks /login has a body.

🤖 Generated with Claude Code

The landing page returned 200 with a zero-byte body in production.

fetch transparently decompresses what it receives, but the proxy forwarded
the child's content-encoding header unchanged — so the response claimed gzip
while carrying plain bytes, and the client decoded it to nothing. The API
paths were unaffected because they are served in-process, and /today was a
redirect with no body, so only the landing page showed it.

The proxy now requests identity encoding from the child and strips
content-encoding, content-length and transfer-encoding from the response it
returns. Those describe the child's wire format, not this one.

CI could not have caught this: plain curl sends no Accept-Encoding, so the
child never compressed and the mismatch never arose. The landing check now
uses --compressed, like a browser, and asserts a non-empty body.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio merged commit 76add76 into main Aug 11, 2026
4 checks passed
@ralyodio
ralyodio deleted the fix/proxy-content-encoding branch August 11, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant