summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-25 22:11:58 -0400
committerUnknwon <u@gogs.io>2016-03-25 22:11:58 -0400
commitdd36c431ece67e47beb0e64070015808627538e5 (patch)
tree55f71d1f15e527fec3f7ab4a38ef5fde3232c3c8
parentb1d41cfa603aee63711fbc23bb02fced5a4c54e3 (diff)
downloadgitea-dd36c431ece67e47beb0e64070015808627538e5.tar.gz
gitea-dd36c431ece67e47beb0e64070015808627538e5.zip
#2842 add quotes to attachment file name
-rw-r--r--routers/repo/download.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/download.go b/routers/repo/download.go
index 3329073e0c..9e7c1d047b 100644
--- a/routers/repo/download.go
+++ b/routers/repo/download.go
@@ -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 {