Skip to content

Commit 011ea19

Browse files
committed
Merge pull request #109 from syntaqx/directory-index
e.Static on Windows
2 parents 356909c + 3e7a663 commit 011ea19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

echo.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"io"
99
"log"
1010
"net/http"
11+
"path"
1112
"reflect"
1213
"runtime"
1314
"strings"
@@ -339,7 +340,7 @@ func serveFile(dir, file string, c *Context) error {
339340

340341
fi, _ := f.Stat()
341342
if fi.IsDir() {
342-
file = filepath.Join(file, "index.html")
343+
file = path.Join(file, "index.html")
343344
f, err = fs.Open(file)
344345
if err != nil {
345346
return NewHTTPError(http.StatusForbidden)

0 commit comments

Comments
 (0)