codeskyblue / codeskyblue/gohttpserver
Fix Symbolic Links To Work as Directory
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 583
- PR merge metrics
- No merged PRs in 30d
Description
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)
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.