1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

#2593 allow render raw content

Use URL query parameter render=1 to render content in raw mode.
This commit is contained in:
Unknwon
2016-08-05 18:34:13 -07:00
parent 28dc5bb566
commit ab9c5fb5e7
7 changed files with 7 additions and 7 deletions

View File

@@ -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)