summaryrefslogtreecommitdiffstats
path: root/routers/repo/download.go
diff options
context:
space:
mode:
authorDon Bowman <don.waterloo@gmail.com>2015-04-08 00:44:38 +0000
committerDon Bowman <don.waterloo@gmail.com>2015-04-08 00:44:38 +0000
commit423b1c69be7828c331a47467b66217d190e916b9 (patch)
tree9c9897bc56f5990842b404572ab1ce75194df5b4 /routers/repo/download.go
parent639e34e362c3e4cea2532de4b811dc8bb916f9f3 (diff)
downloadgitea-423b1c69be7828c331a47467b66217d190e916b9.tar.gz
gitea-423b1c69be7828c331a47467b66217d190e916b9.zip
don't set mime type to text/plain. This will break serving e.g. raw images,
html, etc According to http://golang.org/pkg/net/http/#DetectContentType "If the Header does not contain a Content-Type line, Write adds a Content-Type set to the result of passing the initial 512 bytes of written data to DetectContentType."
Diffstat (limited to 'routers/repo/download.go')
-rw-r--r--routers/repo/download.go1
1 files changed, 0 insertions, 1 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index c5e18e005b..b1c5fbc84d 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -27,7 +27,6 @@ func ServeBlob(ctx *middleware.Context, blob *git.Blob) error {
_, isTextFile := base.IsTextFile(buf)
_, isImageFile := base.IsImageFile(buf)
- ctx.Resp.Header().Set("Content-Type", "text/plain")
if !isTextFile && !isImageFile {
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")