boot: getPath() should take care of simple directory exports. (#3122)

fixes #3120
This commit is contained in:
Krishna Srinivas
2016-10-29 01:38:56 +05:30
committed by Harshavardhana
parent 6a57f2c1f0
commit 79b98b5c25
2 changed files with 42 additions and 39 deletions
+8 -4
View File
@@ -165,12 +165,16 @@ func getPath(ep *url.URL) string {
var diskPath string
// For windows ep.Path is usually empty
if runtime.GOOS == "windows" {
// For full URLs windows drive is part of URL path.
// Eg: http://ip:port/C:\mydrive
if ep.Scheme == "http" || ep.Scheme == "https" {
switch ep.Scheme {
case "":
// Eg. "minio server .\export"
diskPath = ep.Path
case "http", "https":
// For full URLs windows drive is part of URL path.
// Eg: http://ip:port/C:\mydrive
// For windows trim off the preceding "/".
diskPath = ep.Path[1:]
} else {
default:
// For the rest url splits drive letter into
// Scheme contruct the disk path back.
diskPath = ep.Scheme + ":" + ep.Opaque