]> source.dussan.org Git - gitea.git/commitdiff
Set utf-8 charset for text files when serving raw content (#2898)
authorTamás Molnár <moltam@gmail.com>
Wed, 20 Apr 2016 23:38:11 +0000 (01:38 +0200)
committerUnknwon <u@gogs.io>
Wed, 20 Apr 2016 23:38:11 +0000 (19:38 -0400)
routers/repo/download.go

index 9e7c1d047bbac8ed6b639237575b1ab74553054a..acf250acfb41044e9b2e99ecf9ee225cd199405c 100644 (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)