🐛 Escape fname

pull/579/head
Fenny 2020-07-10 22:25:10 +02:00
parent fc5d2d7e66
commit f698b5d506
1 changed files with 1 additions and 1 deletions

2
ctx.go
View File

@ -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")