1
0
mirror of https://github.com/minio/mc.git synced 2025-11-13 12:22:45 +03:00

Windows fixes for Get(), GetObjectMetadata() and List()

This commit is contained in:
Harshavardhana
2015-04-20 17:58:47 -07:00
parent 6109b2a6ff
commit d7e4be17b0
4 changed files with 39 additions and 21 deletions

View File

@@ -124,16 +124,17 @@ func getFilesystemAbsURL(u *url.URL) (string, error) {
if err != nil {
return "", iodine.New(err, nil)
}
case filepath.IsAbs(u.String()):
absURLStr, err = filepath.Abs(filepath.Clean(u.String()))
if err != nil {
return "", iodine.New(err, nil)
}
default:
absURLStr, err = filepath.Abs(filepath.Clean(u.String()))
if err != nil {
return "", iodine.New(err, nil)
}
// url parse converts "\" on windows as "%5c" unescape it
unescapedAbsURL, err := url.QueryUnescape(absURLStr)
if err != nil {
return "", iodine.New(err, nil)
}
absURLStr = unescapedAbsURL
}
return absURLStr, nil
}