Workaround for '+' escaping in Amazon S3. #130

This commit is contained in:
Andrey Smirnov
2014-11-05 02:46:01 +03:00
parent 80a88a2248
commit 552b11e28d
3 changed files with 11 additions and 3 deletions
+9 -1
View File
@@ -140,7 +140,15 @@ func (downloader *downloaderImpl) DownloadWithChecksum(url string, destination s
func (downloader *downloaderImpl) handleTask(task *downloadTask) { func (downloader *downloaderImpl) handleTask(task *downloadTask) {
downloader.progress.Printf("Downloading %s...\n", task.url) downloader.progress.Printf("Downloading %s...\n", task.url)
resp, err := downloader.client.Get(task.url) req, err := http.NewRequest("GET", task.url, nil)
if err != nil {
task.result <- fmt.Errorf("%s: %s", task.url, err)
return
}
req.URL.Opaque = strings.Replace(req.URL.RequestURI(), "+", "%2b", -1)
resp, err := downloader.client.Do(req)
if err != nil { if err != nil {
task.result <- fmt.Errorf("%s: %s", task.url, err) task.result <- fmt.Errorf("%s: %s", task.url, err)
return return
+1 -1
View File
@@ -1,3 +1,3 @@
Downloading http://security.debian.org/dists/wheezy/updates/InRelease... Downloading http://security.debian.org/dists/wheezy/updates/InRelease...
Downloading http://security.debian.org/dists/wheezy/updates/Release... Downloading http://security.debian.org/dists/wheezy/updates/Release...
ERROR: unable to fetch mirror: http://security.debian.org/dists/wheezy/updates/Release: Get http://security.debian.org/dists/wheezy/updates/Release: http: error connecting to proxy http://127.0.0.1:3137: dial tcp 127.0.0.1:3137: connection refused ERROR: unable to fetch mirror: http://security.debian.org/dists/wheezy/updates/Release: Get http:/dists/wheezy/updates/Release: http: error connecting to proxy http://127.0.0.1:3137: dial tcp 127.0.0.1:3137: connection refused
@@ -9,6 +9,6 @@ Last update: never
Information from release file: Information from release file:
Architectures: all Architectures: all
Date: Wed, 01 Oct 2014 18:30:34 UTC Date: Thu, 30 Oct 2014 04:25:46 UTC
Origin: jenkins-ci.org Origin: jenkins-ci.org
Suite: binary Suite: binary