fix(browser): honest blocked-page copy for target-site 4xx/5xx (#39) - #42
Merged
Merged
Conversation
The proxy now relays the upstream HTTP status. On 403/412-style answers the stripped body is the site's own anti-bot challenge page, which until now rendered as if it were site content (bilibili 412 风控 report). classifySiteStatus/sitFailureCopy in src/model/proxy-errors.ts classify the relayed status — 403/412 → site-blocked, 429 → rate limited, other 4xx/5xx → site-error — and browser.ts renders honest human copy with a suggestion to open the address externally. Timeout/abort behavior from #25/#26 is unchanged.
…39) Mocks the proxy contract exactly as the Worker ships it - HTTP 200 envelope carrying the target site's {status: 412} - so reordering the render if/else chain in browser.ts back to the success-first shape renders the anti-bot challenge body and fails CI. Asserts blocked title/copy/status band and that no challenge marker survives in any rendered text.
Xuepoo
force-pushed
the
carryctx/web-0040-browser-compat
branch
from
August 25, 2026 11:11
d76af11 to
41242c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR body
Closes #39 (proxy half already merged: vectojs/webos-proxy#1).
Honest blocked-page handling for the WebOS browser:
src/model/proxy-errors.ts: the proxy's relayed upstream status (not the Worker's 200) classifies the outcome — 403/412 → "site blocked the request" copy with an open-externally hint, 429 → rate-limited wait-and-retry, other 4xx/5xx → site-error. Anti-bot challenge pages can no longer render as content.Live verification (production proxy): wikipedia/github/HN 200 real content; bilibili 412 → honest blocked copy (CF egress IP class is hard-blocked by bilibili risk control regardless of headers).
Gates: 196 pass / 0 fail · tsc · oxlint · oxfmt repo-wide · vite build.