Skip to content

fix(hls): percent-encode DASH rendition names as one path segment - #5116

Merged
kixelated merged 2 commits into
mainfrom
quest/m2/dash-rendition-uri
Oct 11, 2026
Merged

kixelated merged 2 commits into
mainfrom
quest/m2/dash-rendition-uri

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

DASH initialization and media URLs placed the rendition name in the path without percent-encoding it. A name containing / became extra path segments, so video/1080p under broadcast live routed to broadcast live/video, rendition 1080p. ?, #, %, and $ break the same URL. The HLS master playlist already encodes each rendition name as one path segment.

Approach

render_representation encodes the name with the HLS renderer's PATH_SEGMENT set, shared from rs/moq-hls/src/export/master.rs rather than copied, then XML-escapes the finished URL. The Representation id stays the raw name (still XML-escaped, not percent-encoded). $Time$ is left literal because only the name is encoded. Rendering and Route::parse cover /, ?, #, %, and $, including video/1080p under live.

Deletes the finished quest.

Impact

  • Public API: none. PATH_SEGMENT stays pub(crate).
  • Wire: DASH MPD initialization and media URL text changes. Each rendition name is one percent-encoded path segment, using the same RFC 3986 unreserved set as the HLS master. Names that were already a single unreserved segment are unchanged. The Representation id is unchanged. A query string is still XML-escaped once, on the finished URL.

Alternatives

  • Copy the percent-encoding set into the MPD renderer. Rejected: the two layouts would drift.
  • Percent-encode the whole URL, including $Time$. Rejected: DASH substitutes that token.
  • Teach Route::parse to keep a raw slash inside a rendition name. Rejected: a slash is a path separator, so the writer has to encode it.

Follow-ups

None to start. The route parser already decoded a percent-encoded rendition; only the MPD writer was wrong. There is no JS MPD writer. Draft #5083 also edits rs/moq-hls/src/server/routes.rs and may conflict in the test module if it lands first. This branch does not depend on it.

(Written by Grok 4.7)

DASH init and media URLs encode the rendition name with the HLS path-segment set, then XML-escape the finished URL. The Representation id stays raw.
@kixelated

Copy link
Copy Markdown
Collaborator Author

Implemented and left as a draft. just check passed. No maintainer decision is outstanding.

I would not start a follow-up that teaches Route::parse to keep a raw slash, a JS MPD writer, or a rebase onto #5083.

(Written by Grok 4.7)

@kixelated
kixelated marked this pull request as ready for review October 11, 2026 01:22
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3d6fa785-1c6f-499b-bafb-ee6143755cdb

📥 Commits

Reviewing files that changed from the base of the PR and between c6ad626 and 090a3bb.


📒 Files selected for processing (5)
  • quest/m2/README.md
  • quest/m2/dash-rendition-uri.md
  • rs/moq-hls/src/export/master.rs
  • rs/moq-hls/src/export/mpd.rs
  • rs/moq-hls/src/server/routes.rs

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T01:25:46.989311Z 090a3bb Draft marked ready
🔒 Security Review ✅ Completed 2026-10-11T01:25:18.961644Z 090a3bb Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Approved to merge 090a3bba319f92518691f10ae0f758c24f381ae0. Existing current-head CI passes; marking the draft ready triggered Codex's independent code and security reviews, both completed with a thumbs up and no review threads.

The DASH renderer now encodes each rendition name as one URL path segment using the shared HLS character set, then XML-escapes the final URL. Representation IDs and the $Time$ placeholder retain their meaning. Public API is unchanged; MPD URL text now encodes reserved characters correctly. No extra fixes or unresolved decisions.

Enqueuing the reviewed head through the merge queue.

(Written by GPT-6)

@kixelated
kixelated added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit 80d4c66 Oct 11, 2026
7 of 8 checks passed
@kixelated
kixelated deleted the quest/m2/dash-rendition-uri branch October 11, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant