Skip to content

Commit

Permalink
🐛 Escape fname
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenny committed Jul 10, 2020
1 parent fc5d2d7 commit f698b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit f698b5d

Please sign in to comment.