Skip to content

fix: prevent compressed upstream responses from being truncated - #150

Open
Hello2021Year wants to merge 1 commit into
tscircuit:mainfrom
Hello2021Year:codex/bounty-proxy-compressed-response
Open

Hello2021Year wants to merge 1 commit into
tscircuit:mainfrom
Hello2021Year:codex/bounty-proxy-compressed-response

Conversation

@Hello2021Year

Copy link
Copy Markdown

When an upstream sends gzip, fetch decodes the body but retains the compressed Content-Length. Forwarding that length truncates responses through the Node HTTP adapter: a 21,000-byte payload returned only 107 bytes with HTTP 200 in a local Node 22.22.0 reproduction.

Drop the encoded length when forwarding a decoded response through /proxy or the HTTP file proxy. Keep bodies streaming, preserve uncompressed lengths, and preserve the general proxy's HEAD length.

Validation

  • Added direct Response checks for /proxy, query/path downloads, and static file proxies. These catch the mismatch before Bun.serve can repair the header: all four fail on the parent commit (176 vs 21,000 bytes) and pass with this change.
  • Added wire-level gzip/uncompressed checks and uncompressed/gzip HEAD coverage.
  • bun test: 40 passed, 0 failed.
  • bun run format:check, tsc --noEmit, bun run build, and git diff --check: passed.
  • Repeated the real HTTP reproduction with the built bundle and winterspec/adapters/node on Node 22.22.0: all four affected paths returned the complete 21,000-byte payload after the fix.

Implemented with AI assistance; the validation above was executed locally.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T10:48:02.152854Z e514c1c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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