-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(target-gh): Check asset MD5 hash by downloading the asset (#328)
The GitHub API doesn't provide any endpoints to get the hash of an asset. GitHub's response contains an ETag header with the MD5 hash of the asset. In certain cases, the ETag header is not present. This means we don't have the hash of the asset, and thus, we cannot verify the asset correctness. To verify it, we download the file and calculate the hash locally. Files are downloaded into memory, and their size is not checked. This has a risk of downloading too big files, which is something we accept at the moment. The GitHub SDK throws exceptions when server responses are HTTP errors. These interactions are wrapped and more detailed errors are thrown.
- Loading branch information
1 parent
78d2ca9
commit d14a988
Showing
1 changed file
with
58 additions
and
29 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