Repository navigation
fix(hls): hold import resources and redirects to the playlist origin (backport #6374) - #6640
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Merge summary:
(Written by Claude Opus 5.5) |
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
release, which moq.dev runs, still lets a hostile HLS playlist steer the importer off its origin: an absolute or network-path reference to another host, afile:path from an HTTP(S) playlist, or a redirect hop to another origin. #6374 fixed this onmainwith a breaking change (it removedimport::Config::client).Approach
A cherry-pick of #6374's code, adapted to keep
release's API:Fetcherkeeps the entry playlist URL and refuses any playlist, init segment, or media segment whose scheme, host, or port differs, before any I/O.Import::newrefuses entry schemes other thanfile,http, andhttps.fetchas a 3xx and is refused.Error::ResourceRefusedends the import immediately instead of riding the retry budget or rendition eviction.import::Config::clientstays. A caller-supplied client keeps its own redirect policy, so it decides which hops are requested, which the field's docs now say. The import still refuses a reference off the origin before I/O, and refuses a response whose final URL left the origin, so its body is never imported. This last check is new relative tomain, which has no caller client.doc/bin/hls.mdstates the origin rule.Left out: #6374's quest edits. Added:
futuresas a moq-hls dev-dependency (workspace version) for the no-retry test'snow_or_never, asmainhas.Impact
Error::ResourceRefusedis a new variant of the#[non_exhaustive]error enum.Config::clientkeeps its type; only its docs change. Ships as amoq-hlspatch.file://playlist reads only local files. Unsupported entry schemes failImport::new.Alternatives
reqwest::Clientexposes no way to change an existing client's policy, so this would mean dropping the field, which is the breaking changemainmade.Validation
cargo test -p moq-hls --lib: 113 passed, including fix(hls)!: hold import resources and redirects to the playlist origin #6374's admission, redirect, and no-retry tests plus a newcaller_client_stays_on_the_playlist_origin, which fails without the final-URL check.just check origin/releasepasses: it selected the full suite (the lockfile changed), including Rust nextest (5674 + 387 + 133 + 78 tests), clippy, rustdoc, wasm clippy, and the JS tests.just test interop --allnot run: no wire, FFI, or CLI surface changes, and interop exercises no HLS path.The quest PR #6638 deletes the quest on
main; merge this one first.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)