Guard worker fetch relay against null-body-status Response throw - #243
Open
ryanbr wants to merge 1 commit into
Open
Guard worker fetch relay against null-body-status Response throw#243ryanbr wants to merge 1 commit into
ryanbr wants to merge 1 commit into
Conversation
The relay reconstructs responses on the worker side via
new Response(body, { status }). The Response constructor throws a
RangeError when a non-null body is paired with a null-body status
(101/204/205/304) — and the main-thread relay passes body as
await response.text(), which is '' (empty string, not null) for those
statuses. So a 304/204 through the relay (e.g. a conditional
playlist/token request) would throw, the relayed fetch would never
resolve, and the worker would hang until the relay timeout.
Drop the body for null-body statuses. Mirrors GosuDRM/TTV-AB
v9.7.1 / v9.9.0 (shared relay lineage; upstream hit it in the field).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ryanbr
added a commit
that referenced
this pull request
Jun 17, 2026
… throw Mirror of PR #243 (release pair). The worker-side relay rebuilt responses via new Response(body, { status }); a 304/204 through the relay carries an empty-string body (not null), so the Response constructor threw and the relayed fetch hung until timeout. Drop the body for null-body statuses (101/204/205/304). Mirrors TTV-AB v9.7.1 / v9.9.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 24, 2026
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.
Problem
The worker fetch relay reconstructs the worker's fetch responses on the worker side:
new Response(body, { status })throws aRangeErrorwhen a non-null body is paired with a null-body status (101 / 204 / 205 / 304). The main-thread relay supplies the body asawait response.text()— which is an empty string''(notnull) for those statuses. So a 304 Not Modified or 204 returned through the relay (e.g. a conditional playlist/token request) makes the worker-side reconstruction throw: the relayed fetch never resolves, and the worker hangs on it until the relay timeout fires.Fix
Drop the body for null-body statuses before constructing the Response:
Status/statusText/headers are unchanged, as is the
url/redirected/typepost-assignment the IVS WASM validation needs.Scope
npx acornclean on all four files. No version bump (accumulates under## Unreleased).🤖 Generated with Claude Code