1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00

Support for nested folder #100

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2015-06-19 17:52:42 -07:00
parent d04651dc2a
commit fb0a5072b6

View File

@ -338,7 +338,8 @@ func serveFile(dir, file string, c *Context) error {
fi, _ := f.Stat()
if fi.IsDir() {
f, err = fs.Open("index.html")
file = filepath.Join(file, "index.html")
f, err = fs.Open(file)
if err != nil {
return NewHTTPError(http.StatusForbidden)
}