From 39356f423843bcd747bb21526d09bfe6114dde58 Mon Sep 17 00:00:00 2001 From: Tamás Molnár Date: Thu, 21 Apr 2016 01:38:11 +0200 Subject: Set utf-8 charset for text files when serving raw content (#2898) --- routers/repo/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/repo/download.go') diff --git a/routers/repo/download.go b/routers/repo/download.go index 9e7c1d047b..acf250acfb 100644 --- a/routers/repo/download.go +++ b/routers/repo/download.go @@ -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) -- cgit v1.2.3