summaryrefslogtreecommitdiffstats
path: root/routers/repo/download.go
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-08-14 13:38:14 +0800
committer无闻 <u@gogs.io>2015-08-14 13:38:14 +0800
commit8be0bb177b3f28b5cb0afb87bb18db208a11f67d (patch)
tree1aad59af4a874d42621d2a56c7addd5cf012de95 /routers/repo/download.go
parenta463ac178e3d62b9d4e51e727fb8b8927a8bacee (diff)
parent4137426c8836686f06e6de21e7c586df3e798c3a (diff)
downloadgitea-8be0bb177b3f28b5cb0afb87bb18db208a11f67d.tar.gz
gitea-8be0bb177b3f28b5cb0afb87bb18db208a11f67d.zip
Merge pull request #1485 from donbowman/mime-type
43bfee0d4872932c1da185e8367e21795bc4ceb5 reverted my change
Diffstat (limited to 'routers/repo/download.go')
-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))