fixed serving of directory named 'index.html'
This commit is contained in:
parent
7014763271
commit
0065861eab
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
|
@ -173,8 +173,8 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// serve index.html if present (case-sensitive)
|
// serve index.html if present (case-sensitive)
|
||||||
indexPath := filepath.Join(fpath, "index.html")
|
indexPath := fpath + "/index.html"
|
||||||
if _, err := os.Stat(indexPath); err == nil {
|
if indexInfo, err := os.Stat(indexPath); err == nil && !indexInfo.IsDir() {
|
||||||
http.ServeFile(w, r, indexPath)
|
http.ServeFile(w, r, indexPath)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue