From 895613fd4010c800571ef19152152e400ac4ee71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mrozek?= Date: Tue, 4 Apr 2017 06:25:20 +0200 Subject: [PATCH] Fixed skipper for static middleware (#896) --- middleware/static.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/middleware/static.go b/middleware/static.go index a0e637a7..37fd444b 100644 --- a/middleware/static.go +++ b/middleware/static.go @@ -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("*")