fix (path): default path when logging in - #151

This commit is contained in:
= 2019-04-17 16:32:50 +10:00
parent 404c3c01ce
commit 81d224f9e8

View file

@ -55,20 +55,20 @@ func GetHome(b IBackend, base string) (string, error) {
if _, err := b.Ls(base); err != nil {
return base, err
}
home := "/"
if obj, ok := b.(interface{ Home() (string, error) }); ok {
absolute, err := obj.Home()
tmp, err := obj.Home()
if err != nil {
return "", err
return base, err
}
absolute = EnforceDirectory(absolute)
base = EnforceDirectory(base)
if strings.HasPrefix(absolute, base) {
return "/" + absolute[len(base):], nil
}
return "/", nil
home = EnforceDirectory(tmp)
}
return base, nil
base = EnforceDirectory(base)
if strings.HasPrefix(home, base) {
return "/" + home[len(base):], nil
}
return "/", nil
}
func MapStringInterfaceToMapStringString(m map[string]interface{}) map[string]string {