http-types icon indicating copy to clipboard operation
http-types copied to clipboard

parseByteRanges support for unsatisfied ranges

Open joeyh opened this issue 7 years ago • 0 comments

parseByteRanges cannot parse a response like ("Content-Range","bytes */10000")

This can occur when a server does not support a requested range. In particular, I was resuming the download of a file, but the whole file was already actually downloaded. The server responds with partialContent206 and parsing the Content-Range header is the only way to detect if the whole file was already downloaded.

This is called an "unsatisfied-range" in the HTTP RFC, and says it SHOULD be used for a 206 response (leaving open the possibility that some servers send one of the other range formats). None of the ByteRange constructors seem appropriate to parse that into, so it seems that would need a new ByteRangeUnsatisfied constructor.

joeyh avatar Apr 06 '18 19:04 joeyh