Browse Source

Set utf-8 charset for text files when serving raw content (#2898)

tags/v1.21.12.1
Tamás Molnár Unknwon 9 years ago
parent
commit
39356f4238
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/repo/download.go

+ 1
- 1
routers/repo/download.go View File

@@ -29,7 +29,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error {
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
}
} else {
ctx.Resp.Header().Set("Content-Type", "text/plain")
ctx.Resp.Header().Set("Content-Type", "text/plain; charset=utf-8")
}
ctx.Resp.Write(buf)
_, err := io.Copy(ctx.Resp, reader)


Loading…
Cancel
Save