1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-28 08:38:39 +02:00

Merge pull request #109 from syntaqx/directory-index

e.Static on Windows
This commit is contained in:
Vishal Rana 2015-06-24 21:35:46 -07:00
commit 011ea1958f

View File

@ -8,6 +8,7 @@ import (
"io" "io"
"log" "log"
"net/http" "net/http"
"path"
"reflect" "reflect"
"runtime" "runtime"
"strings" "strings"
@ -339,7 +340,7 @@ func serveFile(dir, file string, c *Context) error {
fi, _ := f.Stat() fi, _ := f.Stat()
if fi.IsDir() { if fi.IsDir() {
file = filepath.Join(file, "index.html") file = path.Join(file, "index.html")
f, err = fs.Open(file) f, err = fs.Open(file)
if err != nil { if err != nil {
return NewHTTPError(http.StatusForbidden) return NewHTTPError(http.StatusForbidden)