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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user