maxogden/nugget — pull request #3 by grncdr (2014-10-18 17:26:42+00:00)
Title: Implement resumable downloads (ref. #2)

This implements resumable downloads by attempting to use range requests when the target file already exists.

- A target file is considered incomplete if it's size is less than that of the remote file.
- The remote files size is determined by the content-length returned by a HEAD request to the remote URL.
- If the target files size is greater than or equal to the remote files size, nothing will be done.
- If the remote server does not accept range requests, the existing file will be overwritten.
- Otherwise, the rest of the files contents will be downloaded and appended to the target file by using a `Range` header.