Browse Source

#2842 add quotes to attachment file name

tags/v1.2.0-rc1
Unknwon 9 years ago
parent
commit
019cd8b3db
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/repo/download.go

+ 1
- 1
routers/repo/download.go View File

@@ -25,7 +25,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error {
if !isTextFile {
_, isImageFile := base.IsImageFile(buf)
if !isImageFile {
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+path.Base(ctx.Repo.TreeName)+"\"")
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
}
} else {


Loading…
Cancel
Save