mirror of
https://github.com/labstack/echo.git
synced 2024-11-24 08:22:21 +02:00
Closes #396, echo#WrapMiddleware check error.
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
13563e9aad
commit
cc6b31d0ef
4
echo.go
4
echo.go
@ -477,8 +477,8 @@ func (binder) Bind(i interface{}, c Context) (err error) {
|
||||
func WrapMiddleware(h Handler) MiddlewareFunc {
|
||||
return func(next Handler) Handler {
|
||||
return HandlerFunc(func(c Context) error {
|
||||
if !c.Response().Committed() {
|
||||
h.Handle(c)
|
||||
if err := h.Handle(c); err != nil {
|
||||
return err
|
||||
}
|
||||
return next.Handle(c)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user