diff --git a/context.go b/context.go index 39801f00..73edb9ba 100644 --- a/context.go +++ b/context.go @@ -509,18 +509,17 @@ func (c *context) File(file string) (err error) { return } -func (c *context) Attachment(file, name string) (err error) { +func (c *context) Attachment(file, name string) error { return c.contentDisposition(file, name, "attachment") } -func (c *context) Inline(file, name string) (err error) { +func (c *context) Inline(file, name string) error { return c.contentDisposition(file, name, "inline") } -func (c *context) contentDisposition(file, name, dispositionType string) (err error) { +func (c *context) contentDisposition(file, name, dispositionType string) error { c.response.Header().Set(HeaderContentDisposition, fmt.Sprintf("%s; filename=%q", dispositionType, name)) - c.File(file) - return + return c.File(file) } func (c *context) NoContent(code int) error {