summaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-05 18:34:13 -0700
committerUnknwon <u@gogs.io>2016-08-05 18:34:13 -0700
commitab9c5fb5e7f7b04580e2c53ae08bed3f6623316f (patch)
tree6f07b990dd77869c1b7946ed56be339babe06200 /routers/repo
parent28dc5bb5667c4d1839ad28b33b7145b145f30665 (diff)
downloadgitea-ab9c5fb5e7f7b04580e2c53ae08bed3f6623316f.tar.gz
gitea-ab9c5fb5e7f7b04580e2c53ae08bed3f6623316f.zip
#2593 allow render raw content
Use URL query parameter render=1 to render content in raw mode.
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/download.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index acf250acfb..e9468aa06d 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -28,7 +28,7 @@ func ServeData(ctx *context.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 {
+ } else if !ctx.QueryBool("render") {
ctx.Resp.Header().Set("Content-Type", "text/plain; charset=utf-8")
}
ctx.Resp.Write(buf)