summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/repo/download.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index a0a7823b52..d657d9b18c 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -21,12 +21,7 @@ func ServeData(ctx *middleware.Context, name string, reader io.Reader) error {
}
_, isTextFile := base.IsTextFile(buf)
- if isTextFile {
- charset, _ := base.DetectEncoding(buf)
- if charset != "UTF-8" {
- ctx.Resp.Header().Set("Content-Type", "text/plain; charset="+charset)
- }
- } else {
+ if ! isTextFile {
_, isImageFile := base.IsImageFile(buf)
if !isImageFile {
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))