From f698b5d5066cfe594102ae252cd58a1fe57cf56f Mon Sep 17 00:00:00 2001 From: Fenny <25108519+Fenny@users.noreply.github.com> Date: Fri, 10 Jul 2020 22:25:10 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Escape=20fname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctx.go b/ctx.go index abac99f1..603a7ba0 100644 --- a/ctx.go +++ b/ctx.go @@ -196,7 +196,7 @@ func (ctx *Ctx) Attachment(filename ...string) { if len(filename) > 0 { fname := filepath.Base(filename[0]) ctx.Type(filepath.Ext(fname)) - ctx.Set(HeaderContentDisposition, `attachment; filename="`+fname+`"`) + ctx.Set(HeaderContentDisposition, `attachment; filename="`+url.QueryEscape(fname)+`"`) return } ctx.Set(HeaderContentDisposition, "attachment")