Skip to main content

Module httprange

Module httprange 

Source
Expand description

HTTP range requests for file downloads (RFC 9110, section 14): a client that lost the connection half-way through a large file asks for the rest with Range: bytes=<offset>- and If-Range: "<sha256>" instead of starting over.

Only what resuming needs is supported: one range per request (a list of ranges is answered with the whole file, which RFC 9110 allows), suffix ranges (bytes=-500) and If-Range with the strong ETag of the content ("<sha256>", the same for every version with that content). A date in If-Range never matches, so the client gets the whole file.

Enums§

RangeDecision
What to send for a download request.

Functions§

decide
Decides how to answer a request with the headers range and if_range for a file of size bytes whose ETag is etag.
etag_of
The strong ETag of a file’s content.