From 74a4cc04fed4bccd8f52c6e56f9e3b298b099f8a Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 16 Nov 2017 10:22:12 -0800 Subject: [PATCH 1/3] fix regression :( --- common/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/config.go b/common/config.go index 490553388..cc7eced6a 100644 --- a/common/config.go +++ b/common/config.go @@ -109,6 +109,14 @@ func DownloadableURL(original string) (string, error) { // Make sure it is lowercased url.Scheme = strings.ToLower(url.Scheme) + // This is to work around issue #5927. This can safely be removed once + // we distribute with a version of Go that fixes that bug. + // + // See: https://code.google.com/p/go/issues/detail?id=5927 + if url.Path != "" && url.Path[0] != '/' { + url.Path = "/" + url.Path + } + // Verify that the scheme is something we support in our common downloader. supported := []string{"file", "http", "https"} found := false From 4fb8a27879421803d82e2a5d7d437560a3208d74 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 16 Nov 2017 11:03:10 -0800 Subject: [PATCH 2/3] remove the actual offending code --- common/config.go | 8 -------- common/download.go | 4 ---- 2 files changed, 12 deletions(-) diff --git a/common/config.go b/common/config.go index cc7eced6a..490553388 100644 --- a/common/config.go +++ b/common/config.go @@ -109,14 +109,6 @@ func DownloadableURL(original string) (string, error) { // Make sure it is lowercased url.Scheme = strings.ToLower(url.Scheme) - // This is to work around issue #5927. This can safely be removed once - // we distribute with a version of Go that fixes that bug. - // - // See: https://code.google.com/p/go/issues/detail?id=5927 - if url.Path != "" && url.Path[0] != '/' { - url.Path = "/" + url.Path - } - // Verify that the scheme is something we support in our common downloader. supported := []string{"file", "http", "https"} found := false diff --git a/common/download.go b/common/download.go index 86dea34d1..8061f3223 100644 --- a/common/download.go +++ b/common/download.go @@ -130,10 +130,6 @@ func (d *DownloadClient) Get() (string, error) { // locally and we don't make a copy. Normally we would copy or download. log.Printf("[DEBUG] Using local file: %s", finalPath) - // Remove forward slash on absolute Windows file URLs before processing - if runtime.GOOS == "windows" && len(finalPath) > 0 && finalPath[0] == '/' { - finalPath = finalPath[1:] - } // Keep track of the source so we can make sure not to delete this later sourcePath = finalPath if _, err = os.Stat(finalPath); err != nil { From 3c20176dbb066f55a76ceda6d62e505bbc718117 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 16 Nov 2017 11:10:21 -0800 Subject: [PATCH 3/3] runtime imported but not used --- common/download.go | 1 - 1 file changed, 1 deletion(-) diff --git a/common/download.go b/common/download.go index 8061f3223..8eaf236fc 100644 --- a/common/download.go +++ b/common/download.go @@ -15,7 +15,6 @@ import ( "net/http" "net/url" "os" - "runtime" ) // DownloadConfig is the configuration given to instantiate a new