Skip to content

fix(player): a suffix range on an empty entry is answered whole (#293) - #294

Merged
alekswebnet merged 1 commit into
mainfrom
fix/range-empty-suffix
Nov 26, 2026
Merged

alekswebnet merged 1 commit into
mainfrom
fix/range-empty-suffix

Conversation

@alekswebnet

@alekswebnet alekswebnet commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #293.

parseRange('bytes=-5', 0) returned { start: 0, end: -1 }. It now returns 'none', so the empty body is answered whole with 200.

  • Why not 416: RFC 9110 §14.1.2 makes a non-zero suffix the one range an empty representation satisfies, and §14.2 lets a server ignore Range when there is no content. bytes=0- and bytes=-0 on an empty resource stay unsatisfiable.
  • Reach: none in the worker today. serveLocated answers a size-0 entry before any range is parsed. This fixes the function on its own terms.
  • Tests: range.test.ts has the three empty-resource cases; the player's unit tests pass (401).

#292 rewrites this function's doc comment to say a suffix on size 0 gives end: -1. Whichever of the two merges second gets that line corrected to the fixed behaviour before it merges.


Summary by cubic

Fixes parseRange answering a suffix range on an empty resource with { start: 0, end: -1 }. It now returns 'none', so the empty body is answered whole with a 200; bytes=0- and bytes=-0 on an empty resource remain unsatisfiable.

Written for commit 2750519. Summary will update on new commits.

View guided diff Turn on auto-fix

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@alekswebnet
alekswebnet merged commit 59233cb into main Nov 26, 2026
14 checks passed
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.

player: a suffix range on an empty entry parses to an end of -1

1 participant