Commit 2b41f058 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

common: replace windows file URL backslash with forward slash

/cc @jasonberanek - Just adding this as well because I see this being
common as well.
parent c2654ddb
......@@ -78,6 +78,11 @@ func DownloadableURL(original string) (string, error) {
// since net/url turns "C:/" into "/C:/"
if runtime.GOOS == "windows" && url.Path[0] == '/' {
url.Path = url.Path[1:len(url.Path)]
// Also replace all backslashes with forwardslashes since Windows
// users are likely to do this but the URL should actually only
// contain forward slashes.
url.Path = strings.Replace(url.Path, `\`, `/`, -1)
}
if _, err := os.Stat(url.Path); err != nil {
......
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