diff options
author | Wim <wim@42.be> | 2017-12-07 23:00:56 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2017-12-07 23:00:56 +0100 |
commit | 5c919e6bffbf5dbe057623323effdbed2e82189e (patch) | |
tree | 8e0130ea7387ac1a38c8ceb5b85de1f43435bbe0 /vendor/github.com/labstack/echo/context.go | |
parent | 434393d1c3ade598bd38c98eefe7db93be4c9b27 (diff) | |
download | matterbridge-msglm-5c919e6bffbf5dbe057623323effdbed2e82189e.tar.gz matterbridge-msglm-5c919e6bffbf5dbe057623323effdbed2e82189e.tar.bz2 matterbridge-msglm-5c919e6bffbf5dbe057623323effdbed2e82189e.zip |
Update vendor labstack/echo
Diffstat (limited to 'vendor/github.com/labstack/echo/context.go')
-rw-r--r-- | vendor/github.com/labstack/echo/context.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/vendor/github.com/labstack/echo/context.go b/vendor/github.com/labstack/echo/context.go index 242eec26..54fa71ad 100644 --- a/vendor/github.com/labstack/echo/context.go +++ b/vendor/github.com/labstack/echo/context.go @@ -494,14 +494,9 @@ func (c *context) Stream(code int, contentType string, r io.Reader) (err error) } func (c *context) File(file string) (err error) { - file, err = url.QueryUnescape(file) // Issue #839 - if err != nil { - return - } - f, err := os.Open(file) if err != nil { - return ErrNotFound + return NotFoundHandler(c) } defer f.Close() @@ -510,7 +505,7 @@ func (c *context) File(file string) (err error) { file = filepath.Join(file, indexPage) f, err = os.Open(file) if err != nil { - return ErrNotFound + return NotFoundHandler(c) } defer f.Close() if fi, err = f.Stat(); err != nil { @@ -530,7 +525,7 @@ func (c *context) Inline(file, name string) (err error) { } func (c *context) contentDisposition(file, name, dispositionType string) (err error) { - c.response.Header().Set(HeaderContentDisposition, fmt.Sprintf("%s; filename=%s", dispositionType, name)) + c.response.Header().Set(HeaderContentDisposition, fmt.Sprintf("%s; filename=%q", dispositionType, name)) c.File(file) return } |