mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
#2283 set text/plain for non-binary files in raw mode
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user