Attempt to fix #189 and #130: disable Amazon workaround when using proxy.

This commit is contained in:
Andrey Smirnov
2015-02-03 21:49:55 +03:00
parent 403c7272cd
commit 1b0eb9d45a
2 changed files with 6 additions and 2 deletions

View File

@@ -146,7 +146,11 @@ func (downloader *downloaderImpl) handleTask(task *downloadTask) {
return
}
req.URL.Opaque = strings.Replace(req.URL.RequestURI(), "+", "%2b", -1)
proxyURL, _ := downloader.client.Transport.(*http.Transport).Proxy(req)
if proxyURL == nil && (req.URL.Scheme == "http" || req.URL.Scheme == "https") {
req.URL.Opaque = strings.Replace(req.URL.RequestURI(), "+", "%2b", -1)
req.URL.RawQuery = ""
}
resp, err := downloader.client.Do(req)
if err != nil {