HTTP range reader for zipped Zarr stores (.zarr.zip).
ZipFileStore reads an archive by asking a Reader for byte ranges: first
the tail (to find the central directory), then one range per member. This
module supplies that reader.
It exists rather than reusing @zarrita/storage's own HTTPRangeReader
because that one only asserts response.ok. A server that ignores
Range answers 200 with the WHOLE file, ok is true, and the full body
is handed back as if it were the requested slice — the zip parser then reads
the wrong bytes at every offset. The failure is silent and looks like a
corrupt archive rather than a misconfigured server, and it is not
hypothetical: Python's plain http.server has no Range support at all.
The Playwright fixture server and luxar serve <dir> both provide the
required strict range responses.
So every ranged read here REQUIRES 206 Partial Content, verifies the
returned window, and cross-checks the Content-Range total against the
length learned up front. Range-protocol failures raise
RangeUnsupportedError; missing and access-controlled archives retain
status-specific errors instead of suggesting the wrong fix.
HTTP range reader for zipped Zarr stores (
.zarr.zip).ZipFileStorereads an archive by asking aReaderfor byte ranges: first the tail (to find the central directory), then one range per member. This module supplies that reader.It exists rather than reusing
@zarrita/storage's ownHTTPRangeReaderbecause that one only assertsresponse.ok. A server that ignoresRangeanswers200with the WHOLE file,okis true, and the full body is handed back as if it were the requested slice — the zip parser then reads the wrong bytes at every offset. The failure is silent and looks like a corrupt archive rather than a misconfigured server, and it is not hypothetical: Python's plainhttp.serverhas noRangesupport at all. The Playwright fixture server andluxar serve <dir>both provide the required strict range responses.So every ranged read here REQUIRES
206 Partial Content, verifies the returned window, and cross-checks theContent-Rangetotal against the length learned up front. Range-protocol failures raise RangeUnsupportedError; missing and access-controlled archives retain status-specific errors instead of suggesting the wrong fix.