mirror of
https://gitee.com/gitea/gitea.git
synced 2024-12-01 11:17:47 +08:00
fix download
This commit is contained in:
parent
bce8586bc6
commit
417d861be6
@ -243,7 +243,7 @@ func SingleDownload(ctx *middleware.Context, params martini.Params) {
|
||||
contentType, isTextFile := base.IsTextFile(data)
|
||||
_, isImageFile := base.IsImageFile(data)
|
||||
ctx.Res.Header().Set("Content-Type", contentType)
|
||||
if !isTextFile {
|
||||
if !isTextFile && !isImageFile {
|
||||
ctx.Res.Header().Set("Content-Disposition", "attachment; filename="+filepath.Base(treename))
|
||||
ctx.Res.Header().Set("Content-Transfer-Encoding", "binary")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user