]> source.dussan.org Git - gitea.git/commitdiff
#2842 add quotes to attachment file name
authorUnknwon <u@gogs.io>
Sat, 26 Mar 2016 02:11:58 +0000 (22:11 -0400)
committerUnknwon <u@gogs.io>
Sat, 26 Mar 2016 02:11:58 +0000 (22:11 -0400)
routers/repo/download.go

index 3329073e0c03644b98f16b4460716f87c6fbab5b..9e7c1d047bbac8ed6b639237575b1ab74553054a 100644 (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 {