summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/labstack/echo/v4/context.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-01-09 21:02:56 +0100
committerGitHub <noreply@github.com>2020-01-09 21:02:56 +0100
commit0f708daf2d14dcca261ef98cc698a1b1f2a6aa74 (patch)
tree022eee21366d6a9a00feaeff918972d9e72632c2 /vendor/github.com/labstack/echo/v4/context.go
parentb9354de8fd5e424ac2f246fff1a03b27e8094fd8 (diff)
downloadmatterbridge-msglm-0f708daf2d14dcca261ef98cc698a1b1f2a6aa74.tar.gz
matterbridge-msglm-0f708daf2d14dcca261ef98cc698a1b1f2a6aa74.tar.bz2
matterbridge-msglm-0f708daf2d14dcca261ef98cc698a1b1f2a6aa74.zip
Update dependencies (#975)
Diffstat (limited to 'vendor/github.com/labstack/echo/v4/context.go')
-rw-r--r--vendor/github.com/labstack/echo/v4/context.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/vendor/github.com/labstack/echo/v4/context.go b/vendor/github.com/labstack/echo/v4/context.go
index e0f4cc00..27da5ffe 100644
--- a/vendor/github.com/labstack/echo/v4/context.go
+++ b/vendor/github.com/labstack/echo/v4/context.go
@@ -183,6 +183,9 @@ type (
// Logger returns the `Logger` instance.
Logger() Logger
+ // Set the logger
+ SetLogger(l Logger)
+
// Echo returns the `Echo` instance.
Echo() *Echo
@@ -202,6 +205,7 @@ type (
handler HandlerFunc
store Map
echo *Echo
+ logger Logger
lock sync.RWMutex
}
)
@@ -347,7 +351,8 @@ func (c *context) FormParams() (url.Values, error) {
}
func (c *context) FormFile(name string) (*multipart.FileHeader, error) {
- _, fh, err := c.request.FormFile(name)
+ f, fh, err := c.request.FormFile(name)
+ defer f.Close()
return fh, err
}
@@ -597,9 +602,17 @@ func (c *context) SetHandler(h HandlerFunc) {
}
func (c *context) Logger() Logger {
+ res := c.logger
+ if res != nil {
+ return res
+ }
return c.echo.Logger
}
+func (c *context) SetLogger(l Logger) {
+ c.logger = l
+}
+
func (c *context) Reset(r *http.Request, w http.ResponseWriter) {
c.request = r
c.response.reset(w)
@@ -608,6 +621,9 @@ func (c *context) Reset(r *http.Request, w http.ResponseWriter) {
c.store = nil
c.path = ""
c.pnames = nil
+ c.logger = nil
// NOTE: Don't reset because it has to have length c.echo.maxParam at all times
- // c.pvalues = nil
+ for i := 0; i < *c.echo.maxParam; i++ {
+ c.pvalues[i] = ""
+ }
}