summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/labstack/echo/v4/middleware/timeout.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-07-31 18:27:55 +0200
committerGitHub <noreply@github.com>2021-07-31 18:27:55 +0200
commit44f3e2557dad86129419ed098c29e67638519f4f (patch)
tree17b8ddba49057cd8bf39cdf2618b31c7f6bc8c6a /vendor/github.com/labstack/echo/v4/middleware/timeout.go
parent1f365c716eae44b64dc5bdace5cb70441d7eb4c2 (diff)
downloadmatterbridge-msglm-44f3e2557dad86129419ed098c29e67638519f4f.tar.gz
matterbridge-msglm-44f3e2557dad86129419ed098c29e67638519f4f.tar.bz2
matterbridge-msglm-44f3e2557dad86129419ed098c29e67638519f4f.zip
Update vendor (#1560)
Diffstat (limited to 'vendor/github.com/labstack/echo/v4/middleware/timeout.go')
-rw-r--r--vendor/github.com/labstack/echo/v4/middleware/timeout.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/labstack/echo/v4/middleware/timeout.go b/vendor/github.com/labstack/echo/v4/middleware/timeout.go
index fb8ae421..73113654 100644
--- a/vendor/github.com/labstack/echo/v4/middleware/timeout.go
+++ b/vendor/github.com/labstack/echo/v4/middleware/timeout.go
@@ -2,9 +2,10 @@ package middleware
import (
"context"
- "github.com/labstack/echo/v4"
"net/http"
"time"
+
+ "github.com/labstack/echo/v4"
)
type (
@@ -87,6 +88,10 @@ type echoHandlerFuncWrapper struct {
}
func (t echoHandlerFuncWrapper) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
+ // replace echo.Context Request with the one provided by TimeoutHandler to let later middlewares/handler on the chain
+ // handle properly it's cancellation
+ t.ctx.SetRequest(r)
+
// replace writer with TimeoutHandler custom one. This will guarantee that
// `writes by h to its ResponseWriter will return ErrHandlerTimeout.`
originalWriter := t.ctx.Response().Writer