mirror of
https://github.com/labstack/echo.git
synced 2024-12-22 20:06:21 +02:00
Fix for #681
Premiddleware may embed the echo context in their own custom context. Therefore, it’s important to pass the context flowing down from the premiddleware chain down through the rest of the chain.
This commit is contained in:
parent
7899588eff
commit
76125a53e5
4
echo.go
4
echo.go
@ -545,7 +545,7 @@ func (e *Echo) ServeHTTP(req engine.Request, res engine.Response) {
|
||||
c.Reset(req, res)
|
||||
|
||||
// Middleware
|
||||
h := func(Context) error {
|
||||
h := func(carg Context) error {
|
||||
method := req.Method()
|
||||
path := req.URL().Path()
|
||||
e.router.Find(method, path, c)
|
||||
@ -553,7 +553,7 @@ func (e *Echo) ServeHTTP(req engine.Request, res engine.Response) {
|
||||
for i := len(e.middleware) - 1; i >= 0; i-- {
|
||||
h = e.middleware[i](h)
|
||||
}
|
||||
return h(c)
|
||||
return h(carg)
|
||||
}
|
||||
|
||||
// Premiddleware
|
||||
|
Loading…
Reference in New Issue
Block a user