From 6016350b4c7884cf4e0d7addfe7c59e77bbcd5db Mon Sep 17 00:00:00 2001 From: roxma Date: Mon, 30 Oct 2017 10:55:50 +0800 Subject: [PATCH] Allow using middleware with echo.File --- echo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/echo.go b/echo.go index ce915e5f..811ab254 100644 --- a/echo.go +++ b/echo.go @@ -461,10 +461,10 @@ func static(i i, prefix, root string) *Route { } // 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 c.File(file) - }) + }, m...) } // Add registers a new route for an HTTP method and path with matching handler