mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
Reuse default HTTP transport options.
This commit is contained in:
@@ -45,6 +45,9 @@ type downloadTask struct {
|
||||
// NewDownloader creates new instance of Downloader which specified number
|
||||
// of threads and download limit in bytes/sec
|
||||
func NewDownloader(threads int, downLimit int64, progress aptly.Progress) aptly.Downloader {
|
||||
transport := *http.DefaultTransport.(*http.Transport)
|
||||
transport.DisableCompression = true
|
||||
|
||||
downloader := &downloaderImpl{
|
||||
queue: make(chan *downloadTask, 1000),
|
||||
stop: make(chan bool),
|
||||
@@ -54,10 +57,7 @@ func NewDownloader(threads int, downLimit int64, progress aptly.Progress) aptly.
|
||||
threads: threads,
|
||||
progress: progress,
|
||||
client: &http.Client{
|
||||
Transport: &http.Transport{
|
||||
DisableCompression: true,
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
},
|
||||
Transport: &transport,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user