1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-17 01:43:02 +02:00
This commit is contained in:
Jeffrey Reuling (TI)
2018-03-16 15:05:22 +01:00
committed by Vishal Rana
parent d79727cf89
commit ee32e3e7fb
2 changed files with 33 additions and 4 deletions

12
echo.go
View File

@ -558,13 +558,13 @@ func (e *Echo) ServeHTTP(w http.ResponseWriter, r *http.Request) {
c.Reset(r, w)
method := r.Method
path := r.URL.RawPath
if path == "" {
path = r.URL.Path
}
h := NotFoundHandler
if e.premiddleware == nil {
path := r.URL.RawPath
if path == "" {
path = r.URL.Path
}
e.router.Find(method, path, c)
h = c.Handler()
for i := len(e.middleware) - 1; i >= 0; i-- {
@ -572,6 +572,10 @@ func (e *Echo) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
} else {
h = func(c Context) error {
path := r.URL.RawPath
if path == "" {
path = r.URL.Path
}
e.router.Find(method, path, c)
h := c.Handler()
for i := len(e.middleware) - 1; i >= 0; i-- {