Skip to content

Commit

Permalink
Do not prefix with /
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby committed Dec 10, 2024
1 parent d8e225c commit 42e4a1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/static/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func New(root string, cfg ...Config) fiber.Handler {
}

Check warning on line 111 in middleware/static/static.go

View check run for this annotation

Codecov / codecov/patch

middleware/static/static.go#L109-L111

Added lines #L109 - L111 were not covered by tests

// Clean the path and resolve it against the root
cleanPath := filepath.Clean("/" + utils.UnsafeString(path))
cleanPath := filepath.Clean(utils.UnsafeString(path))
absPath := filepath.Join(absRoot, cleanPath)
relPath, err := filepath.Rel(absRoot, absPath)

Expand Down

0 comments on commit 42e4a1a

Please sign in to comment.