mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +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