diff --git a/echo.go b/echo.go index 500be0ad..dba5b80f 100644 --- a/echo.go +++ b/echo.go @@ -447,7 +447,7 @@ func (e *Echo) Static(prefix, root string) *Route { func static(i i, prefix, root string) *Route { h := func(c Context) error { - p, err := PathUnescape(c.Param("*")) + p, err := url.PathUnescape(c.Param("*")) if err != nil { return err } @@ -749,10 +749,10 @@ func handlerName(h HandlerFunc) string { return t.String() } -// PathUnescape is wraps `url.PathUnescape` -func PathUnescape(s string) (string, error) { - return url.PathUnescape(s) -} +// // PathUnescape is wraps `url.PathUnescape` +// func PathUnescape(s string) (string, error) { +// return url.PathUnescape(s) +// } // tcpKeepAliveListener sets TCP keep-alive timeouts on accepted // connections. It's used by ListenAndServe and ListenAndServeTLS so diff --git a/middleware/static.go b/middleware/static.go index 7208c3a2..cd5fbe89 100644 --- a/middleware/static.go +++ b/middleware/static.go @@ -3,6 +3,7 @@ package middleware import ( "fmt" "net/http" + "net/url" "os" "path" "path/filepath" @@ -76,7 +77,7 @@ func StaticWithConfig(config StaticConfig) echo.MiddlewareFunc { if strings.HasSuffix(c.Path(), "*") { // When serving from a group, e.g. `/static*`. p = c.Param("*") } - p, err = echo.PathUnescape(p) + p, err = url.PathUnescape(p) if err != nil { return }