From ab9c5fb5e7f7b04580e2c53ae08bed3f6623316f Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 5 Aug 2016 18:34:13 -0700 Subject: #2593 allow render raw content Use URL query parameter render=1 to render content in raw mode. --- routers/repo/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers') 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) -- cgit v1.2.3