From 9a38c349112321bb95226c9755179dd3687e3795 Mon Sep 17 00:00:00 2001 From: Makis Maropoulos Date: Thu, 2 Jun 2016 05:05:54 +0300 Subject: [PATCH] ResetBody on EmitError --- httperror.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httperror.go b/httperror.go index d697930d..b704ff57 100644 --- a/httperror.go +++ b/httperror.go @@ -201,7 +201,7 @@ func (he *HTTPErrorContainer) OnError(httpStatus int, handler HandlerFunc) { // EmitError executes the handler of the given error http status code func (he *HTTPErrorContainer) EmitError(errCode int, ctx *Context) { - + ctx.ResetBody() if errHandler := he.GetByCode(errCode); errHandler != nil { ctx.SetStatusCode(errCode) // for any case, user can change it after if want to errHandler.GetHandler().Serve(ctx)