1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-19 21:17:58 +02:00

Fixed static middleware serving index.html

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-04-21 22:25:51 -07:00
parent 1247552c9b
commit c830734fd5

View File

@ -80,10 +80,7 @@ func StaticWithConfig(config StaticConfig) echo.MiddlewareFunc {
// TODO: search all files
file = path.Join(file, config.Index[0])
f, err = fs.Open(file)
if err != nil {
return next(c)
}
if config.Browse {
if err != nil && config.Browse {
dirs, err := d.Readdir(-1)
if err != nil {
return err