mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 06:05:30 +02:00
fix download
This commit is contained in:
1 parent
bce8586bc6
commit
417d861be6
1 file changed
+1
-1
@@ -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")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user