Optionalchecktrue to throw an ERR_HTTP_RESOURCE_CHANGED error when the ETag, Last-Modified or total size headers
returned by a range request differ from the ones returned by the first range request, i.e. when the resource has
been modified while being read. Headers missing from the responses are ignored, note that Access-Control-Expose-Headers
must include them when the resource is fetched cross-origin.
Optionalcombinetrue to read the end of the archive with the same request that gives its size, and to serve the later reads
landing in that range from the response instead of requesting them again, make sure beforehand that the server
supports a suffix range request.
The request asks for the last 65,557 bytes, which is how far back the reader scans for the end of central directory record, so it fetches nothing the reader was not going to read anyway. An archive shorter than that is fetched whole, and reading it then costs a single request.
Optionalforcetrue to always use Range headers when fetching data.
OptionalheadersThe HTTP headers.
OptionalmaximumThe maximum size in bytes of the range requests sent to read the data of an entry. The data is read with as many range requests as necessary, each response body being streamed, so that the size of a request never depends on the size of the entry.
Because response bodies are streamed with backpressure, this value does not bound how much data
is buffered in memory; it bounds the byte span, and therefore the lifetime, of each individual
range request. Smaller windows keep each request short-lived, which avoids the idle or duration
timeouts enforced by servers, CDNs and proxies when a slow consumer holds a connection open, and
avoids relying on the server honoring very large ranges. Set it to Infinity to disable windowing
and read each entry with a single range request covering its whole remaining length.
Optionalpreventtrue to prevent using HEAD HTTP request in order the get the size of the content.
false to explicitly use HEAD, this is useful in case of CORS where Access-Control-Expose-Headers: Content-Range is not returned by the server.
Leaving it unset is not the same as setting it to false when HttpOptions#useRangeHeader or
HttpOptions#forceRangeRequests is set: the size is then read from a ranged GET request instead, and
only an explicit false restores the HEAD request.
false, and true when HttpOptions#useRangeHeader or HttpOptions#forceRangeRequests is set
Optionalusetrue to use Range headers when fetching data from servers returning Accept-Ranges headers.
Optionalusetrue to rely XMLHttpRequest instead of fetch to fetch data.
OptionalfetchThe function used to fetch the data. It takes precedence over HttpRangeOptions#useXHR
when set. The returned object must expose the status, statusText and headers properties,
and the arrayBuffer() method of the Response class.
Optionalinit: RequestInit
Represents the options passed to the constructor of HttpReader.