Skip to content

Commit

Permalink
Allow using middleware with echo.File
Browse files Browse the repository at this point in the history
  • Loading branch information
roxma authored and vishr committed Apr 16, 2018
1 parent b64e4d1 commit 6016350
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6016350

Please sign in to comment.