Skip to content

fix(sirv): return last N bytes for suffix range requests#174

Open
SAY-5 wants to merge 2 commits into
lukeed:mainfrom
SAY-5:fix/range-suffix
Open

fix(sirv): return last N bytes for suffix range requests#174
SAY-5 wants to merge 2 commits into
lukeed:mainfrom
SAY-5:fix/range-suffix

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 13, 2026

RFC 9110 suffix ranges like Range: bytes=-8 should return the trailing N bytes of the file, but the current code parses the missing start as 0 and serves bytes 0-8 instead. Detect the suffix form and compute start = max(0, size - N) so the trailing slice is returned.

Closes #155

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.

Range suffix requests return prefixes instead

1 participant