mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-07-28 18:23:38 +00:00
fix symbolic links issue on Linux. (#281)
This commit is contained in:
parent
6f39464130
commit
d269e239bf
1 changed files with 10 additions and 0 deletions
10
file.go
10
file.go
|
|
@ -133,6 +133,16 @@ func (i *File) GetListing(u *User, r *http.Request) error {
|
|||
continue
|
||||
}
|
||||
|
||||
if strings.HasPrefix(f.Mode().String(), "L") {
|
||||
// It's a symbolic link
|
||||
// The FileInfo from Readdir treats symbolic link as a file only.
|
||||
info, err := os.Stat(f.Name())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f = info
|
||||
}
|
||||
|
||||
if f.IsDir() {
|
||||
name += "/"
|
||||
dirCount++
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue