diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-09-28 01:38:25 -0400 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-09-28 01:38:25 -0400 |
commit | 49193bebd283322bb997b7aed09fc7818a881af9 (patch) | |
tree | 36d99aba259628c518d903da8c74d70b34413eeb /modules | |
parent | ad2ab6d21496e60e7589c44bdfcc15bba01ae9dd (diff) | |
download | gitea-49193bebd283322bb997b7aed09fc7818a881af9.tar.gz gitea-49193bebd283322bb997b7aed09fc7818a881af9.zip |
UI: Confirmation box
Diffstat (limited to 'modules')
-rw-r--r-- | modules/middleware/context.go | 18 |
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 { |