fileserver: show symlink targets verbatim (#7579)

`reveal_symlinks` was exposing symlink targets as fully resolved absolute paths, even if the target is a relative path. With this change the link target is shown as-is, without resolving anything.
This commit is contained in:
Max Truxa 2026-04-14 20:49:30 +02:00 committed by GitHub
parent 0c7c91a447
commit 7586e68e27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,6 @@ import (
"net/url"
"os"
"path"
"path/filepath"
"slices"
"sort"
"strconv"
@ -100,7 +99,7 @@ func (fsrv *FileServer) directoryListing(ctx context.Context, fileSystem fs.FS,
}
if fsrv.Browse.RevealSymlinks {
symLinkTarget, err := filepath.EvalSymlinks(path)
symLinkTarget, err := os.Readlink(path)
if err == nil {
symlinkPath = symLinkTarget
}