diff options
Diffstat (limited to 'routers/repo/download.go')
-rw-r--r-- | routers/repo/download.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go index 85aa76472b..faa30ac9d7 100644 --- a/routers/repo/download.go +++ b/routers/repo/download.go @@ -21,10 +21,8 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error { buf = buf[:n] } - _, isTextFile := base.IsTextFile(buf) - if !isTextFile { - _, isImageFile := base.IsImageFile(buf) - if !isImageFile { + if !base.IsTextFile(buf) { + if !base.IsImageFile(buf) { ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+path.Base(ctx.Repo.TreePath)+"\"") ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary") } |