summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-12-13 22:18:54 -0500
committerenahum <nahumhbl@gmail.com>2016-12-14 00:18:54 -0300
commit51b794501e21e1d19a58bb6dc273a5425c03a107 (patch)
treec8f1dff43a78064bd569a427dc4509f7117418fe /api
parent1b6b69fa8717990bf304f3d7c423934ecfb16f12 (diff)
downloadchat-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.go2
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")