diff --git a/routergroup.go b/routergroup.go index 8a8374b1..2e7a5b90 100644 --- a/routergroup.go +++ b/routergroup.go @@ -201,7 +201,7 @@ func (group *RouterGroup) createStaticHandler(relativePath string, fs http.FileS c.index = -1 return } - defer f.Close() + f.Close() fileServer.ServeHTTP(c.Writer, c.Request) }