fix: escape attachment download filename
This commit is contained in:
parent
c6370bb739
commit
d222d4502a
|
|
@ -210,7 +210,9 @@ func GetTaskAttachment(c *echo.Context) error {
|
|||
mimeToReturn = "application/octet-stream"
|
||||
}
|
||||
|
||||
c.Response().Header().Set("Content-Disposition", "attachment; filename=\""+taskAttachment.File.Name+"\"")
|
||||
filename := strings.ReplaceAll(taskAttachment.File.Name, `"`, `\"`)
|
||||
|
||||
c.Response().Header().Set("Content-Disposition", "attachment; filename=\""+filename+"\"")
|
||||
c.Response().Header().Set("Content-Type", mimeToReturn)
|
||||
c.Response().Header().Set("Content-Length", strconv.FormatUint(taskAttachment.File.Size, 10))
|
||||
c.Response().Header().Set("Last-Modified", taskAttachment.File.Created.UTC().Format(http.TimeFormat))
|
||||
|
|
|
|||
Loading…
Reference in New Issue