diff options
Diffstat (limited to 'routers/repo/download.go')
-rw-r--r-- | routers/repo/download.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go index 83d67a88..3c253f90 100644 --- a/routers/repo/download.go +++ b/routers/repo/download.go @@ -12,6 +12,7 @@ import ( "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/context" + "github.com/gogits/gogs/modules/setting" ) func ServeData(ctx *context.Context, name string, reader io.Reader) error { @@ -26,7 +27,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error { ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+name+"\"") ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary") } - } else if !ctx.QueryBool("render") { + } else if !setting.Repository.EnableRawFileRenderMode || !ctx.QueryBool("render") { ctx.Resp.Header().Set("Content-Type", "text/plain; charset=utf-8") } ctx.Resp.Write(buf) |