fix(cli): read x-content-length when Content-Length is missing - #36
Conversation
Cloudflare drops Content-Length on brotli responses. The API now exposes the origin size as x-content-length so the browser playground can print it. Co-authored-by: Cursor <cursoragent@cursor.com>
Coverage Report for CI Build 34244871702Warning No base build found for commit Coverage: 77.968%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe CLI footer now uses ChangesCLI response size
Estimated code review effort: 1 (Trivial) | ~5 minutes Severity of issue fixed: Low ✨ 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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f6fc41c. Configure here.
| res.statusCode = 200 | ||
| res.setHeader('content-type', 'application/json') | ||
| res.setHeader('x-content-length', bytes) | ||
| res.end(body) |
There was a problem hiding this comment.
Test still sends Content-Length
Low Severity
The new test never leaves content-length unset. Node.js adds that header when res.end is given a body, so the footer still reads content-length and the x-content-length fallback is not exercised. The test would pass without the production change.
Reviewed by Cursor Bugbot for commit f6fc41c. Configure here.


Summary
x-content-lengthwhenContent-Lengthis absent (Cloudflare brotli).0 B.Test plan
search footer reports the response sizestill passes withContent-Lengthx-content-lengthprints that size, not0 BMade with Cursor
Summary by CodeRabbit
Bug Fixes
0 Bsizes from appearing in successful search results.Tests