Merge pull request 'FIX: no longer serving of directory named 'index.html'' (#6) from supitszaire/indir:main into main
Reviewed-on: https://codeberg.org/arimelody/indir/pulls/6
This commit is contained in:
commit
1cd15d51e4
1 changed files with 1 additions and 1 deletions
2
main.go
2
main.go
|
|
@ -174,7 +174,7 @@ func main() {
|
|||
|
||||
// serve index.html if present (case-sensitive)
|
||||
indexPath := filepath.Join(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)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue