Fix dropbox root directory listings

This commit is contained in:
Nick Craig-Wood 2016-05-16 17:54:59 +01:00
parent ad85f6e413
commit 36700d36a7

View File

@ -234,6 +234,8 @@ func strip(path, root string) (string, error) {
if root[len(root)-1] != '/' { if root[len(root)-1] != '/' {
root += "/" root += "/"
} }
} else if len(root) == 0 {
root = "/"
} }
lowercase := strings.ToLower(path) lowercase := strings.ToLower(path)
if !strings.HasPrefix(lowercase, root) { if !strings.HasPrefix(lowercase, root) {