Skip to content

Commit

Permalink
replace / to .
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhan005 committed Aug 8, 2023
1 parent c560531 commit cdaaffa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ func Static(opts ...StaticOptions) Handler {
}

// The go embed file system returns an error when the path ends with a slash or the path is empty.
if file != "/" {
if file == "/" {
file = "."
} else {
file = strings.TrimRight(file, "/")
}

Expand Down

0 comments on commit cdaaffa

Please sign in to comment.