Skip to content

Commit

Permalink
Add an option to allow empty root in the fsHandler
Browse files Browse the repository at this point in the history
this is necessary to restore the capabilities before the commit valyala@c7576cc
and to allow further functionality to be docked from the outside which is not affected by setting the root dir afterwards

gofiber/fiber#1882 (comment)
  • Loading branch information
ReneWerner87 committed May 12, 2022
1 parent 0b7a185 commit a89d4d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs.go
Expand Up @@ -398,9 +398,9 @@ func (fs *FS) initRequestHandler() {
path = "."
}
root = path + "/" + root
// convert the root directory slashes to the native format
root = filepath.FromSlash(root)
}
// convert the root directory slashes to the native format
root = filepath.FromSlash(root)

// strip trailing slashes from the root path
for len(root) > 0 && root[len(root)-1] == os.PathSeparator {
Expand Down

0 comments on commit a89d4d0

Please sign in to comment.