mirror of
https://github.com/labstack/echo.git
synced 2025-01-12 01:22:21 +02:00
parent
c2d29f3895
commit
210dd512d0
2
echo.go
2
echo.go
@ -192,6 +192,7 @@ func (e *Echo) Index(file string) {
|
||||
|
||||
func (e *Echo) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
h, c, echo := e.Router.Find(r.Method, r.URL.Path)
|
||||
defer e.pool.Put(c)
|
||||
if echo != nil {
|
||||
e = echo
|
||||
}
|
||||
@ -205,7 +206,6 @@ func (e *Echo) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
// Handler
|
||||
h(c)
|
||||
e.pool.Put(c)
|
||||
}
|
||||
|
||||
// Run a server
|
||||
|
@ -226,11 +226,11 @@ func (ps Params) Get(n string) (v string) {
|
||||
|
||||
func (r *router) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||
h, c, _ := r.Find(req.Method, req.URL.Path)
|
||||
defer r.echo.pool.Put(c)
|
||||
c.Response.ResponseWriter = rw
|
||||
if h != nil {
|
||||
h(c)
|
||||
} else {
|
||||
r.echo.notFoundHandler(c)
|
||||
}
|
||||
r.echo.pool.Put(c)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user