diff options
author | Unknwon <u@gogs.io> | 2016-08-05 18:34:13 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-05 18:34:13 -0700 |
commit | ab9c5fb5e7f7b04580e2c53ae08bed3f6623316f (patch) | |
tree | 6f07b990dd77869c1b7946ed56be339babe06200 /routers/repo | |
parent | 28dc5bb5667c4d1839ad28b33b7145b145f30665 (diff) | |
download | gitea-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.go | 2 |
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) |