diff --git a/middleware/static.go b/middleware/static.go index 3b734137c..1b31e5479 100644 --- a/middleware/static.go +++ b/middleware/static.go @@ -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