From 4091b6f6b4fe01876f8720332675f9c69be39541 Mon Sep 17 00:00:00 2001 From: Wim Date: Sun, 30 May 2021 00:25:30 +0200 Subject: Update vendor (#1498) --- vendor/github.com/labstack/echo/v4/middleware/timeout.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'vendor/github.com/labstack/echo/v4/middleware/timeout.go') diff --git a/vendor/github.com/labstack/echo/v4/middleware/timeout.go b/vendor/github.com/labstack/echo/v4/middleware/timeout.go index 5d23ff45..fb8ae421 100644 --- a/vendor/github.com/labstack/echo/v4/middleware/timeout.go +++ b/vendor/github.com/labstack/echo/v4/middleware/timeout.go @@ -1,5 +1,3 @@ -// +build go1.13 - package middleware import ( @@ -94,6 +92,15 @@ func (t echoHandlerFuncWrapper) ServeHTTP(rw http.ResponseWriter, r *http.Reques originalWriter := t.ctx.Response().Writer t.ctx.Response().Writer = rw + // in case of panic we restore original writer and call panic again + // so it could be handled with global middleware Recover() + defer func() { + if err := recover(); err != nil { + t.ctx.Response().Writer = originalWriter + panic(err) + } + }() + err := t.handler(t.ctx) if ctxErr := r.Context().Err(); ctxErr == context.DeadlineExceeded { if err != nil && t.errHandler != nil { -- cgit v1.2.3