mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-01-23 02:35:10 +00:00
fix: do not expose the name of the root directory (#5224)
This commit is contained in:
parent
5331969163
commit
089255997a
2 changed files with 6 additions and 1 deletions
|
|
@ -86,6 +86,11 @@ func NewFileInfo(opts *FileOptions) (*FileInfo, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Do not expose the name of root directory.
|
||||
if file.Path == "/" {
|
||||
file.Name = ""
|
||||
}
|
||||
|
||||
if opts.Expand {
|
||||
if file.IsDir {
|
||||
if err := file.readListing(opts.Checker, opts.ReadHeader); err != nil { //nolint:govet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue