mirror of https://github.com/gofiber/fiber.git
🐛 Escape fname
parent
fc5d2d7e66
commit
f698b5d506
2
ctx.go
2
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")
|
||||
|
|
Loading…
Reference in New Issue