Skip to content

Commit a8ad545

Browse files
authored
Merge pull request #579 from Fenny/master
🐛 Escape fname
2 parents fa29783 + f698b5d commit a8ad545

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ctx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func (ctx *Ctx) Attachment(filename ...string) {
196196
if len(filename) > 0 {
197197
fname := filepath.Base(filename[0])
198198
ctx.Type(filepath.Ext(fname))
199-
ctx.Set(HeaderContentDisposition, `attachment; filename="`+fname+`"`)
199+
ctx.Set(HeaderContentDisposition, `attachment; filename="`+url.QueryEscape(fname)+`"`)
200200
return
201201
}
202202
ctx.Set(HeaderContentDisposition, "attachment")

0 commit comments

Comments
 (0)