1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-01 22:09:21 +02:00

Fixed skipper for static middleware (#896)

This commit is contained in:
Michał Mrozek 2017-04-04 06:25:20 +02:00 committed by Vishal Rana
parent d67c6f029c
commit 895613fd40

View File

@ -67,6 +67,10 @@ func StaticWithConfig(config StaticConfig) echo.MiddlewareFunc {
return func(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
if config.Skipper(c) {
return next(c)
}
p := c.Request().URL.Path
if strings.HasSuffix(c.Path(), "*") { // When serving from a group, e.g. `/static*`.
p = c.Param("*")