summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-15 00:42:57 +0800
committerUnknwon <u@gogs.io>2015-08-15 00:42:57 +0800
commit13a74c3a0c946fc844ce9287fd87f2d91aab48d9 (patch)
treec6f413db2275d7576e83a5265875f24bbe65a670
parentcec38f2a8cf4f6721cc412d1d6cf3ea6f25b16c7 (diff)
parent8be0bb177b3f28b5cb0afb87bb18db208a11f67d (diff)
downloadgitea-13a74c3a0c946fc844ce9287fd87f2d91aab48d9.tar.gz
gitea-13a74c3a0c946fc844ce9287fd87f2d91aab48d9.zip
Merge branch 'develop' of github.com:gogits/gogs into feature/pull_request2
-rw-r--r--conf/locale/TRANSLATORS1
-rw-r--r--routers/repo/download.go7
2 files changed, 2 insertions, 6 deletions
diff --git a/conf/locale/TRANSLATORS b/conf/locale/TRANSLATORS
index 75424b666b..62966b7b45 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 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))