From dd36c431ece67e47beb0e64070015808627538e5 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 25 Mar 2016 22:11:58 -0400 Subject: #2842 add quotes to attachment file name --- routers/repo/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers') 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 { -- cgit v1.2.3