-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't attempt range request without object size
The range logic was being erroneously applied when there was no Content-Length returned by the HEAD call. Clone the http header when copying them to new requests, so that changes are not inadvertently reflected in the caller. The GetFile method still has the unfortunate behavior of not verifying the destination file for the range request (which it currently can't, because there is no metadata to compare). This means that a call to replace an existing file when the server supports byte-range, will either succeed if the new length is <= the previous, or corrupt the file by appending new bytes. Silent corruption can be avoided by added a `checksum` parameter to the go-getter request, but will still result in failure to download. Update the HttpGetter.GetFile method docs to reflect this behavior. In most cases however the caller is not looking at the HttpGetter itself, as go-getter is attempting to abstract this away. This means there needs to be global support in the Client to make this a viable option. How to add this can be decided separate from this fix.
- Loading branch information
Showing
2 changed files
with
79 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters