fix(flaresolverr): pass an ordinary 403/503 through decoded once #63
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 205 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.319
Real PR Conversation Timeline
1 comments
"Review active on #63"
general
weight: 0.35
coderabbitai[bot]
Found on romarr.moveweight.com, which has a FlareSolverr URL configured. A keyless Demozoo search failed with "DecodingError: Error -3 while decompressing data" instead of Demozoo's own 403 and the plugin's API-key instructions. Without FlareSolverr, the same search showed the 403 correctly.
Cause.
FlareSolverrTransport.handle_requesthandles a 403 or 503 that is not a Cloudflare challenge by callingresponse.read(), which decodes the body, and re-wrapping it in a newhttpx.Responsewith the original headers. Those headers still sayContent-Encoding: gzip, so httpx decodes a second time and zlib fails. That broke every ordinary 403 or 503 from a gzip-serving site, whenever FlareSolverr was set.Fix. On re-wrap, drop the wire-level headers (
Content-Encoding,Content-Length,Transfer-Encoding). The body and the other headers are unchanged.Test:
test_an_ordinary_gzip_403_reaches_the_caller_decoded_oncefails onmasterwith the same zlib error and passes with the fix. All 7 tests in the file pass.🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Fixed handling of certain error responses so their decoded content displays correctly without conflicting transfer or encoding information.
* Preserved the original response status and other headers. Regular 403 responses continue to be returned directly without invoking the challenge solver.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->