mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
fix: bypass errors on symbolic links
This commit is contained in:
parent
22327703fd
commit
df453ca634
9
file.go
9
file.go
@ -134,13 +134,12 @@ func (i *File) GetListing(u *User, r *http.Request) error {
|
||||
}
|
||||
|
||||
if strings.HasPrefix(f.Mode().String(), "L") {
|
||||
// It's a symbolic link
|
||||
// The FileInfo from Readdir treats symbolic link as a file only.
|
||||
// It's a symbolic link. We try to follow it. If it doesn't work,
|
||||
// we stay with the link information instead if the target's.
|
||||
info, err := os.Stat(f.Name())
|
||||
if err != nil {
|
||||
return err
|
||||
if err == nil {
|
||||
f = info
|
||||
}
|
||||
f = info
|
||||
}
|
||||
|
||||
if f.IsDir() {
|
||||
|
Loading…
Reference in New Issue
Block a user