fixed serving of directory named 'index.html'

This commit is contained in:
claire treise 2026-03-16 22:44:21 +01:00
parent 7014763271
commit 0065861eab

View file

@ -173,8 +173,8 @@ func main() {
}
// serve index.html if present (case-sensitive)
indexPath := filepath.Join(fpath, "index.html")
if _, err := os.Stat(indexPath); err == nil {
indexPath := fpath + "/index.html"
if indexInfo, err := os.Stat(indexPath); err == nil && !indexInfo.IsDir() {
http.ServeFile(w, r, indexPath)
return
}