소스 검색

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

Tamás Molnár 9 년 전
부모
커밋
39356f4238
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      routers/repo/download.go

+ 1 - 1
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)