#2283 set text/plain for non-binary files in raw mode
This commit is contained in:
parent
85af36332b
commit
93f03707a7
5 changed files with 10 additions and 4 deletions
|
@ -28,6 +28,8 @@ func ServeData(ctx *middleware.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 {
|
||||
ctx.Resp.Header().Set("Content-Type", "text/plain")
|
||||
}
|
||||
ctx.Resp.Write(buf)
|
||||
_, err := io.Copy(ctx.Resp, reader)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue