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:
parent
b64e4d12c7
commit
6016350b4c
4
echo.go
4
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
|
||||
|
Loading…
Reference in New Issue
Block a user