mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-27 13:57:46 +00:00
Reenable checksums
This commit is contained in:
+15
-15
@@ -2,10 +2,10 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
// "crypto/md5"
|
"crypto/md5"
|
||||||
// "crypto/sha1"
|
"crypto/sha1"
|
||||||
// "crypto/sha256"
|
"crypto/sha256"
|
||||||
// "crypto/sha512"
|
"crypto/sha512"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/aptly-dev/aptly/utils"
|
"github.com/aptly-dev/aptly/utils"
|
||||||
"github.com/cavaliercoder/grab"
|
"github.com/cavaliercoder/grab"
|
||||||
@@ -80,17 +80,17 @@ func (d *GrabDownloader) download(ctx context.Context, url string, destination s
|
|||||||
req, _ := grab.NewRequest(destination, url)
|
req, _ := grab.NewRequest(destination, url)
|
||||||
|
|
||||||
// TODO ignoreMismatch
|
// TODO ignoreMismatch
|
||||||
// if expected != nil {
|
if expected != nil {
|
||||||
// if expected.MD5 != "" {
|
if expected.MD5 != "" {
|
||||||
// req.SetChecksum(md5.New(), []byte(expected.MD5), true)
|
req.SetChecksum(md5.New(), []byte(expected.MD5), true)
|
||||||
// } else if expected.SHA1 != "" {
|
} else if expected.SHA1 != "" {
|
||||||
// req.SetChecksum(sha1.New(), []byte(expected.SHA1), true)
|
req.SetChecksum(sha1.New(), []byte(expected.SHA1), true)
|
||||||
// } else if expected.SHA256 != "" {
|
} else if expected.SHA256 != "" {
|
||||||
// req.SetChecksum(sha256.New(), []byte(expected.SHA256), true)
|
req.SetChecksum(sha256.New(), []byte(expected.SHA256), true)
|
||||||
// } else if expected.SHA512 != "" {
|
} else if expected.SHA512 != "" {
|
||||||
// req.SetChecksum(sha512.New(), []byte(expected.SHA512), true)
|
req.SetChecksum(sha512.New(), []byte(expected.SHA512), true)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
resp := d.client.Do(req)
|
resp := d.client.Do(req)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user