Fix Symbolic Links To Work as Directory
morb14 opened this issue · comments
morb commented
In httpstaticserver.go replace:
if info.IsDir() {
name := deepPath(realPath, info.Name())
lr.Name = name
lr.Path = filepath.Join(filepath.Dir(path), name)
lr.Type = "dir"
lr.Size = s.historyDirSize(lr.Path)
} else {
lr.Type = "file"
lr.Size = info.Size() // formatSize(info)
}
with:
if info.Mode()&os.ModeSymlink != 0 {
lr.Type = "dir"
lr.Size = info.Size()
} else if info.IsDir() {
name := deepPath(realPath, info.Name())
lr.Name = name
lr.Path = filepath.Join(filepath.Dir(path), name)
lr.Type = "dir"
lr.Size = s.historyDirSize(lr.Path)
} else {
lr.Type = "file"
lr.Size = info.Size() // formatSize(info)
}