← Back to Pull requests

fix(flaresolverr): pass an ordinary 403/503 through decoded once #63

Open
unknown opened this pull request with 205 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 22, 2026 19:32 UTC
Author

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_request handles a 403 or 503 that is not a Cloudflare challenge by calling response.read(), which decodes the body, and re-wrapping it in a new httpx.Response with the original headers. Those headers still say Content-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_once fails on master with 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 -->

Diff: 205 lines (+153 / -52) across 2 files Reviewer: coderabbitai[bot] Review duration: 7m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.3% (MEDIUM) · Higher = larger blast radius
36.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19.4% · Safe to merge
19.4%