When using Streams, the
Transfer-Encoding header is set to
chunked, which results in
Content-Length being unset/invalid as per HTTP 1.1 protocol.
The issue with this is that it seems to completely break resumable downloads, at least in Chrome. The biggest issue is that unlike non-Streamed Responses with a
Content-Length set, when using Streamed responses with no
Content-Length - if there is a network dropout, Chrome just deletes the
.crdownload file that has the current progress. So if you are downloading a 1GB file, and get a network dropout at 500Mb, say goodbye to your progress.
I have tried setting a
Content-Range: bytes 0-FULL_SIZE/FULL_SIZE to see if that would get Chrome to respect resumability despite being a
chunked transfer, to no avail.
Is there some other header I can send to make Chrome allow for resumable downloads when using Streams? So it wont delete the progress on network error, and so it will send a
Range request on resume, like it does when using non-Streamed