Repository navigation
fix(download): answer Range on an empty cache entry the same way on every storage driver - #291
Merged
Merged
Conversation
An empty entry has no satisfiable range. The filesystem and GCS adapters raise RangeNotSatisfiable for any Range on one, Azure for any start past 0, while RustFS (the S3 backend in CI) answers bytes=0- with an empty 200. The response therefore depended on the configured storage driver. The route now ignores Range when the entry is empty and sends an empty 200, which RFC 9110 section 14.2 allows. Claude-Session: https://claude.ai/code/session_01RdsMKiGYJmUC1RdLmCBsN2 (cherry picked from commit f053636)
… hangs up Guards the client-abort half of #282: with sendStream an aborted download kept reading the backend and held its reader lease until it expired. Claude-Session: https://claude.ai/code/session_01RdsMKiGYJmUC1RdLmCBsN2 (cherry picked from commit c8f7c93)
LouisHaftmann
added a commit
that referenced
this pull request
Oct 24, 2026
Ports #291: a Range on an empty entry is ignored on every storage driver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 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.
📝 Summary
A Range request on an empty Cache Entry got a different answer depending on the storage driver:
416on filesystem and GCS,200or416on Azure depending on the start, and an empty200on S3. Now every driver answers with an empty200. RFC 9110 §14.2 allows ignoring Range, and the route already does that for unmerged entries.This also adds the missing test for the client-abort half of #282: if the client hangs up mid-download, the route destroys the storage stream, which releases the Storage Reader Lease.
Both commits are by @peter-svensson, cherry-picked unchanged from their fork.
✅ Verification
sqlite + filesystem,
tests/range-download.test.tsandtests/proxy-backpressure.test.ts:an empty merged entry answers bytes=0- / bytes=5- with an empty 200fails withexpected 416 to be 200After: passes
sendStreamin place ofpipeline,download destroys the storage stream when the client hangs upfails withexpected false to be trueAfter: passes with
pipeline(13/13 tests pass in both files)S3, GCS, and Azure Blob were not run locally; CI's matrix covers them.
🔗 Issues
Closes #290
💥 Merge danger
Door: two-way
Blast Radius: small
Only affects Range requests on empty Cache Entries, which used to get a
416on some drivers.🤖 Generated with Claude Code