Commit 44008c32 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge pull request #2121 from josharian/no-scrub-empty

common: two minor fixes
parents 4413e60b 2fe785ed
...@@ -14,6 +14,9 @@ import ( ...@@ -14,6 +14,9 @@ import (
func ScrubConfig(target interface{}, values ...string) string { func ScrubConfig(target interface{}, values ...string) string {
conf := fmt.Sprintf("Config: %+v", target) conf := fmt.Sprintf("Config: %+v", target)
for _, value := range values { for _, value := range values {
if value == "" {
continue
}
conf = strings.Replace(conf, value, "<Filtered>", -1) conf = strings.Replace(conf, value, "<Filtered>", -1)
} }
return conf return conf
...@@ -96,14 +99,6 @@ func DownloadableURL(original string) (string, error) { ...@@ -96,14 +99,6 @@ func DownloadableURL(original string) (string, error) {
// Make sure it is lowercased // Make sure it is lowercased
url.Scheme = strings.ToLower(url.Scheme) 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. // Verify that the scheme is something we support in our common downloader.
supported := []string{"file", "http", "https"} supported := []string{"file", "http", "https"}
found := false found := false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment