summaryrefslogtreecommitdiffstats
path: root/api/file.go
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-10-09 16:45:40 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-10-09 16:45:40 -0400
commite5a019390d91890bd098511f4845e27ff7bda430 (patch)
tree8312c43ef9a150ed4367bc195b06d52ef58e24b6 /api/file.go
parent12cd7c03d6676466f7b10b8e80b4e05edab0cf2a (diff)
downloadchat-e5a019390d91890bd098511f4845e27ff7bda430.tar.gz
chat-e5a019390d91890bd098511f4845e27ff7bda430.tar.bz2
chat-e5a019390d91890bd098511f4845e27ff7bda430.zip
Fixed download links in Safari
Diffstat (limited to 'api/file.go')
-rw-r--r--api/file.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/file.go b/api/file.go
index 9ebcd821b..429347596 100644
--- a/api/file.go
+++ b/api/file.go
@@ -408,11 +408,11 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Length", strconv.Itoa(len(f)))
w.Header().Del("Content-Type") // Content-Type will be set automatically by the http writer
- // attach extra headers to trigger a download on IE and Edge
+ // attach extra headers to trigger a download on IE, Edge, and Safari
ua := user_agent.New(r.UserAgent())
bname, _ := ua.Browser()
- if bname == "Edge" || bname == "Internet Explorer" {
+ if bname == "Edge" || bname == "Internet Explorer" || bname == "Safari" {
// trim off anything before the final / so we just get the file's name
parts := strings.Split(filename, "/")