From 50fed083a734a56786826cd579a0867b97a1995c Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Tue, 2 Aug 2016 13:11:12 -0700 Subject: [PATCH] Fixed #608 Signed-off-by: Vishal Rana --- echo.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/echo.go b/echo.go index e20a5289..d9468858 100644 --- a/echo.go +++ b/echo.go @@ -284,7 +284,11 @@ func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) { msg = err.Error() } if !c.Response().Committed() { - c.String(code, msg) + if c.Request().Method() == HEAD { // Issue #608 + c.NoContent(code) + } else { + c.String(code, msg) + } } e.logger.Error(err) }