mirror of
https://github.com/pgsty/minio.git
synced 2026-07-25 06:56:18 +03:00
boot: getPath() should take care of simple directory exports. (#3122)
fixes #3120
This commit is contained in:
committed by
Harshavardhana
parent
6a57f2c1f0
commit
79b98b5c25
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user