mirror of
https://github.com/labstack/echo.git
synced 2025-07-17 01:43:02 +02:00
Fixed skipper for static middleware (#896)
This commit is contained in:
committed by
Vishal Rana
parent
d67c6f029c
commit
895613fd40
@ -67,6 +67,10 @@ func StaticWithConfig(config StaticConfig) echo.MiddlewareFunc {
|
|||||||
|
|
||||||
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
return func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||||
return func(c echo.Context) error {
|
return func(c echo.Context) error {
|
||||||
|
if config.Skipper(c) {
|
||||||
|
return next(c)
|
||||||
|
}
|
||||||
|
|
||||||
p := c.Request().URL.Path
|
p := c.Request().URL.Path
|
||||||
if strings.HasSuffix(c.Path(), "*") { // When serving from a group, e.g. `/static*`.
|
if strings.HasSuffix(c.Path(), "*") { // When serving from a group, e.g. `/static*`.
|
||||||
p = c.Param("*")
|
p = c.Param("*")
|
||||||
|
Reference in New Issue
Block a user