diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-12-13 22:18:54 -0500 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-12-14 00:18:54 -0300 |
commit | 51b794501e21e1d19a58bb6dc273a5425c03a107 (patch) | |
tree | c8f1dff43a78064bd569a427dc4509f7117418fe /api | |
parent | 1b6b69fa8717990bf304f3d7c423934ecfb16f12 (diff) | |
download | chat-51b794501e21e1d19a58bb6dc273a5425c03a107.tar.gz chat-51b794501e21e1d19a58bb6dc273a5425c03a107.tar.bz2 chat-51b794501e21e1d19a58bb6dc273a5425c03a107.zip |
Fixed encoding of file name when downloading attachments (#4787)
Diffstat (limited to 'api')
-rw-r--r-- | api/file.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/api/file.go b/api/file.go index 8de69937a..b91ea7d4e 100644 --- a/api/file.go +++ b/api/file.go @@ -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") |