diff options
-rw-r--r-- | conf/locale/TRANSLATORS | 1 | ||||
-rw-r--r-- | routers/repo/download.go | 7 |
2 files changed, 2 insertions, 6 deletions
diff --git a/conf/locale/TRANSLATORS b/conf/locale/TRANSLATORS index 75424b66..62966b7b 100644 --- a/conf/locale/TRANSLATORS +++ b/conf/locale/TRANSLATORS @@ -14,3 +14,4 @@ Luc Stepniewski <luc@stepniewski.fr> Miguel de la Cruz <miguel@mcrx.me> Natan Albuquerque <natanalbuquerque5@gmail.com> Marc Schiller <marc@schiller.im> +Gregor Santner <gdev@live.de> diff --git a/routers/repo/download.go b/routers/repo/download.go index a0a7823b..d657d9b1 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)) |