Replace quotes only, instead of using strconv.Quote

This commit is contained in:
Neil Alexander 2020-06-16 17:55:08 +01:00
parent 12c8373f93
commit d954d709e2

View file

@ -309,7 +309,7 @@ func (r *downloadRequest) respondFromLocalFile(
}
w.Header().Set("Content-Disposition", fmt.Sprintf(
`inline; filename=utf-8"%s"`,
strconv.Quote(uploadName),
strings.ReplaceAll(uploadName, `"`, `\"`), // escape quote marks only, as per RFC6266
))
}
}