summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-25 05:45:07 -0500
committerUnknwon <u@gogs.io>2015-12-25 05:45:07 -0500
commit93f03707a789a4d538c945c9838fa4ec4d3ef15c (patch)
treecdffa6724be6466da634e69abc03ab105e6f7ae1 /routers
parent85af36332b89a42152c7e2b76af5e2aeb048103a (diff)
downloadgitea-93f03707a789a4d538c945c9838fa4ec4d3ef15c.tar.gz
gitea-93f03707a789a4d538c945c9838fa4ec4d3ef15c.zip
#2283 set text/plain for non-binary files in raw mode
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/download.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index cb863c6133..a10792b87f 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -28,6 +28,8 @@ func ServeData(ctx *middleware.Context, name string, reader io.Reader) error {
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
}
+ } else {
+ ctx.Resp.Header().Set("Content-Type", "text/plain")
}
ctx.Resp.Write(buf)
_, err := io.Copy(ctx.Resp, reader)