forked from forgejo/forgejo
#2593 allow render raw content
Use URL query parameter render=1 to render content in raw mode.
This commit is contained in:
parent
28dc5bb566
commit
ab9c5fb5e7
7 changed files with 7 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue