You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works as intended, fs.FS implementations should validate paths with https://pkg.go.dev/io/fs#ValidPath which rejects trailing slashes. If you want to serve index.html then you need to rewrite/redirect the request, see what http.FileServer does.
This works as intended, fs.FS implementations should validate paths with https://pkg.go.dev/io/fs#ValidPath which rejects trailing slashes. If you want to serve index.html then you need to rewrite/redirect the request, see what http.FileServer does.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
the same as
fmt.Println(staticFS.Open("test"))
What did you see instead?
It cause http.FS can not found index.html, because dir always end with
/
The text was updated successfully, but these errors were encountered: