Hacker News new | ask | show | jobs
by cnrcode 51 days ago
One caveat with that trick: if the server picked a different file or the link now points at a new version, Firefox will happily splice the old .part onto the new bytes and you get a corrupt file with no error. Resume requests only check the range, so unless the server returns an ETag or Last-Modified that matches, nothing guarantees the two halves belong together. Worth checking a hash afterwards if the source publishes one.
1 comments

if the downloads were not idempotent, then yes, this method will simply splice two different files together. But presumably, most downloads are idempotent.
It would be good to have a hash as part of headers, otherwise this is not an acceptable risk by default.