diff options
author | Unknwon <u@gogs.io> | 2015-08-15 00:42:57 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-15 00:42:57 +0800 |
commit | 13a74c3a0c946fc844ce9287fd87f2d91aab48d9 (patch) | |
tree | c6f413db2275d7576e83a5265875f24bbe65a670 /routers/repo | |
parent | cec38f2a8cf4f6721cc412d1d6cf3ea6f25b16c7 (diff) | |
parent | 8be0bb177b3f28b5cb0afb87bb18db208a11f67d (diff) | |
download | gitea-13a74c3a0c946fc844ce9287fd87f2d91aab48d9.tar.gz gitea-13a74c3a0c946fc844ce9287fd87f2d91aab48d9.zip |
Merge branch 'develop' of github.com:gogits/gogs into feature/pull_request2
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/download.go | 7 |
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)) |