mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-11 03:11:50 +00:00
Print redirects being followed, drop mirror.yandex.ru.
Use CDN-backed Debian mirror to make tests run faster hopefully for everyone. Redirects might be important to know what exactly is going on when items are being downloaded.
This commit is contained in:
committed by
Andrey Smirnov
parent
021b6f694b
commit
26098f6c8d
@@ -53,6 +53,7 @@ func NewDownloader(downLimit int64, maxTries int, progress aptly.Progress) aptly
|
||||
},
|
||||
}
|
||||
|
||||
downloader.client.CheckRedirect = downloader.checkRedirect
|
||||
if downLimit > 0 {
|
||||
downloader.aggWriter = flowrate.NewWriter(progress, downLimit)
|
||||
} else {
|
||||
@@ -62,6 +63,14 @@ func NewDownloader(downLimit int64, maxTries int, progress aptly.Progress) aptly
|
||||
return downloader
|
||||
}
|
||||
|
||||
func (downloader *downloaderImpl) checkRedirect(req *http.Request, via []*http.Request) error {
|
||||
if downloader.progress != nil {
|
||||
downloader.progress.Printf("Following redirect to %s...\n", req.URL)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetProgress returns Progress object
|
||||
func (downloader *downloaderImpl) GetProgress() aptly.Progress {
|
||||
return downloader.progress
|
||||
|
||||
Reference in New Issue
Block a user