Fixed encoding of file name when downloading attachments (#4787)

Этот коммит содержится в:
Harrison Healey
2016-12-13 22:18:54 -05:00
коммит произвёл enahum
родитель 1b6b69fa87
Коммит 51b794501e

Просмотреть файл

@@ -529,7 +529,7 @@ func writeFileResponse(filename string, contentType string, bytes []byte, w http
w.Header().Del("Content-Type") // Content-Type will be set automatically by the http writer
}
w.Header().Set("Content-Disposition", "attachment;filename=\""+filename+"\"")
w.Header().Set("Content-Disposition", "attachment;filename=\""+filename+"\"; filename*=UTF-8''"+url.QueryEscape(filename))
// prevent file links from being embedded in iframes
w.Header().Set("X-Frame-Options", "DENY")