summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/labstack/echo/context.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-12-07 23:00:56 +0100
committerWim <wim@42.be>2017-12-07 23:00:56 +0100
commit5c919e6bffbf5dbe057623323effdbed2e82189e (patch)
tree8e0130ea7387ac1a38c8ceb5b85de1f43435bbe0 /vendor/github.com/labstack/echo/context.go
parent434393d1c3ade598bd38c98eefe7db93be4c9b27 (diff)
downloadmatterbridge-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.go11
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
}