mirror of
https://git.sr.ht/~adnano/go-gemini
synced 2024-11-23 16:52:06 +01:00
fs: Trim trailing slash from name in ServeFile
This commit is contained in:
parent
bf95ca8ed8
commit
a14c0c1825
2
fs.go
2
fs.go
@ -46,7 +46,7 @@ func ServeFile(w ResponseWriter, fsys fs.FS, name string) {
|
||||
if name == "/" {
|
||||
name = "."
|
||||
} else {
|
||||
name = strings.TrimPrefix(name, "/")
|
||||
name = strings.Trim(name, "/")
|
||||
}
|
||||
|
||||
f, err := fsys.Open(name)
|
||||
|
Loading…
Reference in New Issue
Block a user