diff options
author | Tamás Molnár <moltam@gmail.com> | 2016-04-21 01:38:11 +0200 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-04-20 19:38:11 -0400 |
commit | 39356f423843bcd747bb21526d09bfe6114dde58 (patch) | |
tree | 42c4820c2350e3964232abc3c7381a9e5232872d /routers | |
parent | b3c05026df1ed3664541c1fb3e8c2da693a0eded (diff) | |
download | gitea-39356f423843bcd747bb21526d09bfe6114dde58.tar.gz gitea-39356f423843bcd747bb21526d09bfe6114dde58.zip |
Set utf-8 charset for text files when serving raw content (#2898)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/download.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) |