Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Andres Virviescas Santana committed Jun 21, 2021
1 parent 378479a commit 5e3b2f5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ func (r *Router) Static(url, rootPath string) *Path {
// Make sure your program has enough 'max open files' limit aka
// 'ulimit -n' if root folder contains many files.
func (r *Router) StaticCustom(url string, fs *StaticFS) *Path {
if strings.HasSuffix(url, "/") {
url = url[:len(url)-1]
}
url = strings.TrimSuffix(url, "/")

ffs := &fasthttp.FS{
Root: fs.Root,
Expand Down

0 comments on commit 5e3b2f5

Please sign in to comment.