1
0
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:
weisdd 2016-03-13 17:18:43 +08:00 committed by Vishal Rana
parent 13563e9aad
commit cc6b31d0ef

View File

@ -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)
})