1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Allow using middleware with echo.File

This commit is contained in:
roxma 2017-10-30 10:55:50 +08:00 committed by Vishal Rana
parent b64e4d12c7
commit 6016350b4c

View File

@ -461,10 +461,10 @@ func static(i i, prefix, root string) *Route {
} }
// File registers a new route with path to serve a static file. // File registers a new route with path to serve a static file.
func (e *Echo) File(path, file string) *Route { func (e *Echo) File(path, file string, m ...MiddlewareFunc) *Route {
return e.GET(path, func(c Context) error { return e.GET(path, func(c Context) error {
return c.File(file) return c.File(file)
}) }, m...)
} }
// Add registers a new route for an HTTP method and path with matching handler // Add registers a new route for an HTTP method and path with matching handler