summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/middleware/context.go18
1 files changed, 0 insertions, 18 deletions
diff --git a/modules/middleware/context.go b/modules/middleware/context.go
index 9145038fb0..90716d2c59 100644
--- a/modules/middleware/context.go
+++ b/modules/middleware/context.go
@@ -9,7 +9,6 @@ import (
"html/template"
"io"
"net/http"
- "path"
"strings"
"time"
@@ -140,23 +139,6 @@ func (ctx *Context) Handle(status int, title string, err error) {
ctx.HTML(status, base.TplName(fmt.Sprintf("status/%d", status)))
}
-func (ctx *Context) ServeFile(file string, names ...string) {
- var name string
- if len(names) > 0 {
- name = names[0]
- } else {
- name = path.Base(file)
- }
- ctx.Resp.Header().Set("Content-Description", "File Transfer")
- ctx.Resp.Header().Set("Content-Type", "application/octet-stream")
- ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+name)
- ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
- ctx.Resp.Header().Set("Expires", "0")
- ctx.Resp.Header().Set("Cache-Control", "must-revalidate")
- ctx.Resp.Header().Set("Pragma", "public")
- http.ServeFile(ctx.Resp, ctx.Req, file)
-}
-
func (ctx *Context) ServeContent(name string, r io.ReadSeeker, params ...interface{}) {
modtime := time.Now()
for _, p := range params {