fix(proxy): strip encoded loop headers#261
Conversation
Preserve the local loop proxy fix before returning the checkout to main. The proxy already removes hop-by-hop headers; encoded upstream bodies also need matching encoding headers stripped so Starlette does not advertise gzip for decoded fixture bodies.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbitBug Fixes
WalkthroughSeparate ChangesLoop Backend Proxy Header Denylist
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4fc6c86d4
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
|
|
||
| _REQUEST_HEADER_DENYLIST = _HOP_BY_HOP | {"accept-encoding"} | ||
| _RESPONSE_HEADER_DENYLIST = _HOP_BY_HOP | {"content-encoding"} |
There was a problem hiding this comment.
Preserve unsupported response encodings
Because this drops Content-Encoding for every upstream response, responses whose bytes were not decoded by urllib3 become corrupt. That happens for encodings urllib3 does not support in this runtime, for example br because the repo does not install brotli/brotlicffi, or for any backend that sends encoded bytes despite the identity request; upstream.read() returns the encoded payload, but the browser no longer sees the header needed to decode it. Please either disable urllib3 decoding and preserve the header, or strip it only when the payload was actually decoded.
Useful? React with 👍 / 👎.
Context & Intent
Implementation Details
MVP / Deployment Risk Check
UX Framework Alignment (For UI/Drill changes)
Verification: