1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2017-01-31 13:55:39 -08:00
parent 52fa135fd5
commit c7c4395fbd
3 changed files with 11 additions and 10 deletions

View File

@ -543,9 +543,9 @@ func (c *context) Logger() Logger {
}
func (c *context) Reset(r *http.Request, w http.ResponseWriter) {
c.query = nil
c.store = nil
c.request = r
c.response.reset(w)
c.query = nil
c.handler = NotFoundHandler
c.store = nil
}

16
echo.go
View File

@ -59,6 +59,14 @@ import (
type (
// Echo is the top-level framework instance.
Echo struct {
stdLogger *slog.Logger
colorer *color.Color
premiddleware []MiddlewareFunc
middleware []MiddlewareFunc
maxParam *int
router *Router
notFoundHandler HandlerFunc
pool sync.Pool
Server *http.Server
TLSServer *http.Server
Listener net.Listener
@ -72,14 +80,6 @@ type (
AutoTLSManager autocert.Manager
Mutex sync.RWMutex
Logger Logger
stdLogger *slog.Logger
colorer *color.Color
premiddleware []MiddlewareFunc
middleware []MiddlewareFunc
maxParam *int
router *Router
notFoundHandler HandlerFunc
pool sync.Pool
}
// Route contains a handler and information for matching against requests.

View File

@ -297,6 +297,7 @@ func (n *node) checkMethodNotAllowed() HandlerFunc {
// - Reset it `Context#Reset()`
// - Return it `Echo#ReleaseContext()`.
func (r *Router) Find(method, path string, context Context) {
context.SetPath(path)
cn := r.tree // Current node as root
var (