working better

This commit is contained in:
Henrique Dias committed 2017-07-03 15:19:17 +01:00
1 parent 8d891f0d51
commit 12c466d2aa
20 files changed
+292 -250

No files matched your search

+5
View File
@@ -99,6 +99,11 @@ func getInfo(url *url.URL, c *FileManager, u *User) (*file, error) {
i.IsDir = info.IsDir()
i.Size = info.Size()
i.Extension = filepath.Ext(i.Name)
if i.IsDir && !strings.HasSuffix(i.URL, "/") {
i.URL += "/"
}
return i, nil
}